Skip to content

Commit 329db44

Browse files
committed
fix: report nested network errors
1 parent 6883998 commit 329db44

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

skill/dependency-cve-audit/audit.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,9 @@ async function main() {
328328
const isMain = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)
329329
if (isMain) {
330330
main().catch((error) => {
331-
const cause = error?.cause
332-
? `\nCaused by: ${cause.stack ?? cause.code ?? cause.message ?? String(cause)}`
331+
const nested = error?.cause
332+
const cause = nested
333+
? `\nCaused by: ${nested.stack ?? nested.code ?? nested.message ?? String(nested)}`
333334
: ""
334335
process.stderr.write(`${error.stack ?? error.message}${cause}\n`)
335336
process.exitCode = 1

0 commit comments

Comments
 (0)