From 8fdf0ab231270e8e9e146cacb455cfac526332b6 Mon Sep 17 00:00:00 2001 From: Contra Date: Mon, 14 Jul 2014 12:21:29 -0700 Subject: [PATCH] clean up code for #587 close --- bin/gulp.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/gulp.js b/bin/gulp.js index ad7a8d129..689387168 100755 --- a/bin/gulp.js +++ b/bin/gulp.js @@ -147,18 +147,18 @@ function formatError(e) { return e.message; } - if (typeof e.err === 'string') { - return new Error(e.err).stack; - } - // PluginError if (typeof e.err.showStack === 'boolean') { return e.err.toString(); - } else { + } + + // normal error + if (e.err.stack) { return e.err.stack; } - return String(e.err); + // unknown (string, number, etc.) + return new Error(String(e.err)).stack; } // wire up logging events