Skip to content

Commit

Permalink
[FIX] Print error cause stack trace
Browse files Browse the repository at this point in the history
The CLI now also prints the stack trace of the error cause of
unexpected errors or when verbose logging is enabled.

This improves error analysis in case an error is caught and re-thrown
as "cause" of a new error, e.g. during minification.
  • Loading branch information
matz3 committed Aug 14, 2024
1 parent 80a6931 commit 323845c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/cli/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ export default function(cli) {
process.stderr.write("\n");
process.stderr.write(err.stack);
process.stderr.write("\n");
if (err.cause instanceof Error && err.cause.stack) {
process.stderr.write(chalk.underline("Error Cause Stack Trace:\n"));
process.stderr.write(err.cause.stack + "\n");
process.stderr.write("\n");
}
process.stderr.write(
chalk.dim(
`If you think this is an issue of the UI5 Tooling, you might report it using the ` +
Expand Down

0 comments on commit 323845c

Please sign in to comment.