diff --git a/lib/cli/run.js b/lib/cli/run.js index fbbe510e94..1cb4ecea5a 100644 --- a/lib/cli/run.js +++ b/lib/cli/run.js @@ -369,7 +369,7 @@ exports.handler = async function (argv) { try { await runMocha(mocha, argv); } catch (err) { - console.error('\n' + (err.stack || `Error: ${err.message || err}`)); + console.error('\n' + (err.stack || `Error: ${err && err.message}`), err); process.exit(1); } };