Skip to content

Commit 265a266

Browse files
committed
[INTERNAL] Print error cause stack trace
This improves error analysis as the FileLinter catches errors and re-throws them with the original error as "cause". However, this information is missing when printed to the console output so often it is not clear where an exception originates from.
1 parent 8ce429d commit 265a266

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/ui5-linter/src/cli/base.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ export default function base(cli: yargs.Argv) {
141141
process.stderr.write(err.stack + "\n");
142142
process.stderr.write("\n");
143143
}
144+
if (err.cause instanceof Error && err.cause.stack) {
145+
process.stderr.write(chalk.underline("Error Cause Stack Trace:\n"));
146+
process.stderr.write(err.cause.stack + "\n");
147+
process.stderr.write("\n");
148+
}
144149
process.stderr.write(
145150
chalk.dim(
146151
`If you think this is an issue of the ui5-linter, you might report it using the ` +

0 commit comments

Comments
 (0)