-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't swallow Error message/stack when using formatter (#1188)
* Don't swallow Error message/stack when using formatter Fixes #1178 When we use a formatter and pass an `Error` object in as `meta`, we end up removing the Error's message and stack information when `decycle`ing it. `clone` checks if the passed-in object is an `Error` and does not `decycle` it in that case, but when we use a formatter, this check does not happen because we `clone` the whole `options` object instead of just cloning `options.meta`. By `clone`ing `meta` alone when it is an Error, the `instanceof Error` check will catch it and copy `message` and `stack` into a new, non-Error object. So when that's buried in `options.meta`, re-`clone`ing it won't hurt. * Add test Add test for "Don't swallow Error message/stack when using formatter", which Fixes #1178
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters