diff --git a/lib/cli/run.js b/lib/cli/run.js index 6eb5ed9a49..92908be435 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) { - if (!err) { + if (!err || !err.toString) { console.error('\n Undefined error:', err); } else { console.error('\n' + (err.stack || `Error: ${err.message || err}`));