File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { arrayUnique } from '@socketsecurity/registry/lib/arrays'
22import { debugDir } from '@socketsecurity/registry/lib/debug'
33import { logger } from '@socketsecurity/registry/lib/logger'
44import { getOwn } from '@socketsecurity/registry/lib/objects'
5+ import { isNonEmptyString } from '@socketsecurity/registry/lib/strings'
56
67import { toFilterConfig } from './filter-config.mts'
78import { extractPurlsFromPnpmLockfile } from './pnpm.mts'
@@ -102,10 +103,13 @@ export async function getAlertsMapFromPurls(
102103 alertsMapOptions ,
103104 )
104105 } else if ( ! opts . nothrow ) {
106+ spinner ?. stop ( )
107+ if ( isNonEmptyString ( batchResult . error ) ) {
108+ throw new Error ( batchResult . error )
109+ }
105110 const statusCode = batchResult . status ?? 'unknown'
106- const statusMessage = batchResult . error ?? 'No status message'
107111 throw new Error (
108- `Socket API server error (${ statusCode } ): ${ statusMessage } ` ,
112+ `Socket API server error (${ statusCode } ): No status message ` ,
109113 )
110114 } else {
111115 spinner ?. stop ( )
You can’t perform that action at this time.
0 commit comments