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

Call captureStackTrace to filter boom from traces #68

Merged
merged 2 commits into from
Sep 22, 2015
Merged

Conversation

kpdecker
Copy link
Contributor

Fixes #67


internals.internal = function (message, data, statusCode, ctor) {

var error = (data instanceof Error ? exports.wrap(data, statusCode, message) : internals.create(statusCode || 500, message, ctor));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rewrite this as an if else? I find executing functions inside ternary operators a little hard to follow for the humans.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply porting the existing code defined in the original method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, but since you're in there anyway... 🍰

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update later tonight.

@arb arb self-assigned this Sep 21, 2015
@arb arb added the feature New functionality or improvement label Sep 21, 2015
@arb
Copy link
Contributor

arb commented Sep 21, 2015

Do we want to expose something to make this behavior configurable?

@kpdecker
Copy link
Contributor Author

Regarding making this configurable, what is the use case for consumers of boom (vs. authors of boom)? From the consumer perspective I can't think of a case where they should care about the internals. From the author perspective, you do loose some potential data but this seems to be a reasonable price considering the relatively limited internal complexity of the library and the benefit provided to users.

@hueniverse
Copy link
Contributor

Dropping the boom part of the stack makes sense to me. I don't think a setting it useful here.

@kpdecker
Copy link
Contributor Author

Changed the internal.internal method to internal.serverError

@arb
Copy link
Contributor

arb commented Sep 22, 2015

This looks great. How do you think this should be versioned? My gut tells me major since we are changing the shape of the error stack and someone could be relying on the way it used to work.

Thoughts @hueniverse?

@kpdecker
Copy link
Contributor Author

The error stack's content was never api, right? Major seems unnecessary.
Minor or patch would be a toss up in my mind but I could argue for either
one and feel like it's an ok choice.
On Tue, Sep 22, 2015 at 7:52 AM Adam Bretz [email protected] wrote:

This looks great. How do you think this should be versioned? My gut tells
me major since we are changing the shape of the error stack and someone
could be relying on the way it used to work.

Thoughts @hueniverse https://github.com/hueniverse?


Reply to this email directly or view it on GitHub
#68 (comment).

@AdriVanHoudt
Copy link
Contributor

I would also go with minor or patch, not part of "public api" and would be weird to rely on the fact that it is in there imo

@arb arb modified the milestone: 2.9.0 Sep 22, 2015
arb added a commit that referenced this pull request Sep 22, 2015
Call captureStackTrace to filter boom from traces
@arb arb merged commit 62f51e6 into master Sep 22, 2015
@arb arb deleted the capture-stack branch September 22, 2015 14:06
@arb arb restored the capture-stack branch September 22, 2015 14:06
@arb arb deleted the capture-stack branch September 22, 2015 14:06
@hueniverse
Copy link
Contributor

Minor.

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use captureStackTrace to remove boom artifacts from stack traces
5 participants