Skip to content

Commit

Permalink
chore(tool): print error.stack if error.message is empty (#8769)
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored May 8, 2023
1 parent 3045526 commit c3a054c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tool/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ function tryOrExit<T extends ActionParameters>(
await f({ options, ...args } as T);
} catch (e) {
const error = e as Error;
if (options.verbose || options.v) {
if (
options.verbose ||
options.v ||
(error instanceof Error && !error.message)
) {
console.error(chalk.red(error.stack));
}
throw error;
Expand Down

0 comments on commit c3a054c

Please sign in to comment.