Skip to content

Commit dd88210

Browse files
committed
fix: print error when internal cli error happens
There have been issues where the reported error is "ERROR: null", which is very unhelpful. Here is an analysis of a specific example: #5048 (comment) Although the trigger for that error was fixed by #5074, the unhelpfulness of "ERROR: null" was not addressed. To help with debugging, this patch prints the original error when this stage is unexpectedly reached.
1 parent abf3dd9 commit dd88210

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/cli/cli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ exports.main = (argv = process.argv.slice(2), mochaArgs) => {
6161
debug('caught error sometime before command handler: %O', err);
6262
yargs.showHelp();
6363
console.error(`\n${symbols.error} ${pc.red('ERROR:')} ${msg}`);
64+
console.error(err);
6465
process.exit(1);
6566
})
6667
.help('help', 'Show usage information & exit')

0 commit comments

Comments
 (0)