diff --git a/lib/utils/logger.js b/lib/utils/logger.js index f47f9634..946bc159 100644 --- a/lib/utils/logger.js +++ b/lib/utils/logger.js @@ -9,7 +9,9 @@ module.exports = class Logger { const { LOG_LEVEL, NODE_ENV } = process.env; const logLevelFromNodeEnv = NODE_ENV === 'test' ? 'fatal' : 'info'; const errorSerializer = DEV_ENVS.includes(NODE_ENV) ? err : wrapErrorSerializer(err => { - err.stack = err.stack.split('\n').slice(0, 3).join('\n'); + if (err.hasOwnProperty('stack')) { + err.stack = err.stack.split('\n').slice(0, 3).join('\n'); + } return err; }); const options = {