diff --git a/lib/bunyan.js b/lib/bunyan.js index 405cdb24..9e459211 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -1127,8 +1127,8 @@ Logger.stdSerializers.res = function (res) { function getFullErrorStack(ex) { var ret = ex.stack || ex.toString(); - if (ex.cause && typeof (ex.cause) === 'function') { - var cex = ex.cause(); + if (ex.cause) { + var cex = typeof (ex.cause) === 'function' ? ex.cause() : ex.cause; if (cex) { ret += '\nCaused by: ' + getFullErrorStack(cex); }