Be defensive on err.stack not being a string. Fixes #242.
This commit is contained in:
parent
6f81f4b1e1
commit
24528aa638
2 changed files with 6 additions and 2 deletions
|
@ -8,7 +8,7 @@ Known issues:
|
|||
|
||||
## bunyan 1.3.5 (not yet released)
|
||||
|
||||
(nothing yet)
|
||||
- [issue #242] Be defensive on err.stack not being a string.
|
||||
|
||||
|
||||
## bunyan 1.3.4
|
||||
|
|
|
@ -976,7 +976,11 @@ function emitRecord(rec, line, opts, stylize) {
|
|||
|
||||
if (rec.err && rec.err.stack) {
|
||||
var err = rec.err
|
||||
if (typeof (err.stack) !== 'string') {
|
||||
details.push(indent(err.stack.toString()));
|
||||
} else {
|
||||
details.push(indent(err.stack));
|
||||
}
|
||||
delete err.message;
|
||||
delete err.name;
|
||||
delete err.stack;
|
||||
|
|
Loading…
Reference in a new issue