From c3a054c947cd8f4bcad924408ecb3a13e31678e2 Mon Sep 17 00:00:00 2001 From: Claas Augner <495429+caugner@users.noreply.github.com> Date: Mon, 8 May 2023 16:18:21 +0200 Subject: [PATCH] chore(tool): print error.stack if error.message is empty (#8769) --- tool/cli.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tool/cli.ts b/tool/cli.ts index 5b5cd7368014..2f0379e1f3d0 100644 --- a/tool/cli.ts +++ b/tool/cli.ts @@ -236,7 +236,11 @@ function tryOrExit( 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;