Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't swallow Error message/stack when using formatter #1188

Commits on Jan 25, 2018

  1. Don't swallow Error message/stack when using formatter

    Fixes winstonjs#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.
    Evan Battaglia committed Jan 25, 2018
    Configuration menu
    Copy the full SHA
    ca96f55 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2018

  1. Add test

    Add test for "Don't swallow Error message/stack when using formatter",
    which Fixes winstonjs#1178
    Evan Battaglia committed Feb 28, 2018
    Configuration menu
    Copy the full SHA
    6c0bcec View commit details
    Browse the repository at this point in the history