We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents be5316e + 8a866fd commit e7a6c88Copy full SHA for e7a6c88
lib/format.js
@@ -19,7 +19,7 @@ define(function() {
19
* @returns {String} formatted string, suitable for output to developers
20
*/
21
function formatError(e) {
22
- var s = typeof e === 'object' && e !== null && e.stack ? e.stack : formatObject(e);
+ var s = typeof e === 'object' && e !== null && (e.stack || e.message) ? e.stack || e.message : formatObject(e);
23
return e instanceof Error ? s : s + ' (WARNING: non-Error used)';
24
}
25
0 commit comments