add .message error fallback

This commit is contained in:
TJ Holowaychuk 2013-04-16 07:09:48 -07:00
parent 7793512aef
commit f4c8e1ea6c
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ debug.enabled = function(name) {
*/
function coerce(val) {
if (val instanceof Error) return val.stack;
if (val instanceof Error) return val.stack || val.message;
return val;
}

View File

@ -142,6 +142,6 @@ function debug(name) {
*/
function coerce(val) {
if (val instanceof Error) return val.stack;
if (val instanceof Error) return val.stack || val.message;
return val;
}