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

Ensure stack is present for custom errors (fixes #351) #360

Merged
merged 1 commit into from Jul 30, 2017

Commits on Jul 30, 2017

  1. Ensure stack is present for custom errors (fixes nodeca#351)

    Starting in Node 7, stack traces are computed eagerly when using Error.captureStackTrace [1]. As a result, the `message` and `name` properties of an error will not be included in the `stack` property if they are set after calling `Error.captureStackTrace`. As a workaround, set the properties before calling `Error.captureStackTrace`.
    
    Note that this change in Node was reverted in V8 a few days ago [2], but it will probably be awhile until that fix appears in a Node release.
    
    [1] https://chromium.googlesource.com/v8/v8.git/+/4feafee9d9741259e8ec3882fb61935a235ecc54
    [2] https://chromium.googlesource.com/v8/v8.git/+/989d7b96f8352b502e2ede62e0b105e143d03837
    not-an-aardvark committed Jul 30, 2017
    Configuration menu
    Copy the full SHA
    e05323e View commit details
    Browse the repository at this point in the history