Skip to content

Commit 89ca41b

Browse files
committed
fix: removed stack trace for errors
1 parent 13c638d commit 89ca41b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/utils/utils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,6 @@ function outputFormatterError(err: any): string {
450450
} else {
451451
output += '\n';
452452
}
453-
if (err.stack) {
454-
output += `${indent}stack: ${JSON.stringify(err.stack)}\n`;
455-
}
456453
output += `${indent}cause: `;
457454
err = err.cause;
458455
} else if (err instanceof ErrorPolykey) {
@@ -485,6 +482,13 @@ function outputFormatterError(err: any): string {
485482
} else {
486483
break;
487484
}
485+
} else if (err instanceof Error) {
486+
output += `${err.name}`;
487+
if (err.message && err.message !== '') {
488+
output += `: ${err.message}`;
489+
}
490+
output += '\n';
491+
break;
488492
} else {
489493
output += composeErrorMessage(err);
490494
if (err.message && err.message !== '') {

0 commit comments

Comments
 (0)