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

Append the cause() stacks to the main stack trace #2381

Closed
wants to merge 3 commits into from

Commits on Jul 19, 2016

  1. Append the cause() stacks to the main stack trace

    Some Errors support a cause() method that when called returns the error that caused it. Examples are VError, https://github.com/davepacheco/node-verror, and restify v2.0, https://github.com/mcavage/node-restify.
    
    The cause() is useful when errors are wrapped using something like VError to preserve the full stack traces by appending the stack traces of the cause() to that of the original error.
    
    This is something that eg. Bunyan does https://github.com/trentm/node-bunyan/blob/cbfaa9a7bd86c658dbb8333c894191d23b65be33/lib/bunyan.js#L1111 and this method is inspired by its implementation. Bunyan in turn was inspired by extsprintf: https://github.com/davepacheco/node-extsprintf/blob/accc9f2774189a416f294546ed03b626eec3f80c/lib/extsprintf.js#L165
    voxpelli committed Jul 19, 2016
    Configuration menu
    Copy the full SHA
    e6d6d4d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0a0ae59 View commit details
    Browse the repository at this point in the history
  3. Consistent variable names

    voxpelli committed Jul 19, 2016
    Configuration menu
    Copy the full SHA
    b148dc2 View commit details
    Browse the repository at this point in the history