Skip to content

Commit

Permalink
Check that the toString method is available on the error.
Browse files Browse the repository at this point in the history
  • Loading branch information
stalet committed Feb 8, 2024
1 parent 8b7613c commit 3a11def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`));
Expand Down

0 comments on commit 3a11def

Please sign in to comment.