]> git.example.dev Git - binbsis50.git/commitdiff
log the error message when the stack trace is not available
authorLuigi Pinca <luigipinca@gmail.com>
Fri, 17 Jul 2015 11:52:37 +0000 (13:52 +0200)
committerLuigi Pinca <luigipinca@gmail.com>
Fri, 17 Jul 2015 11:52:37 +0000 (13:52 +0200)
lib/sparks.js

index e3c7c6a644ebca35e65b7cab92e7f07d3451e7d4..13b4565268de906d3078b1bfeedebd3c767a52c6 100644 (file)
@@ -55,7 +55,7 @@ module.exports = function(options) {
   primus.on('log', function(type) {
     if (type === 'error') {
       var err = arguments[1];
-      console.error(err.stack);
+      console.error(err.stack || err.message);
     }
   });