-
Notifications
You must be signed in to change notification settings - Fork 22
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
Include original error stack trace for Rollbar when throwing error in block pipeline #2973
Comments
Indeed, we discussed this before I think:
I'll re-read your long comment in that last thread as it contains a lot information about a setup that we haven't fully achieved yet. Related: Do you think I should work on this so we don't have to worry about serialized errors anymore? Also: |
I looked into a few solutions:
Here's for example what the result of So I can suggest just appending the stack like everyone else seems to be doing, something like: try {
throw new Error('Original')
} catch (original) {
const composed = new Error('New details: ' + original.message)
composed.stack += '\n' + original.stack
throw composed;
} and it results into: Pros:
I'll turn this pattern into a helper so we can create such wrappers easily, like: class ContextError extend WrappedError {
constructor(message, cause, context) {
super(message, cause); // Will automatically concatenate the message and stacks
this.context = context;
}
} |
Additionally, for the long term, we'd want
|
Opened a ticket with rollbar: rollbar/rollbar.js#1010 A workaround might be to overload the payload transform method? (Which is where we currently re-write the host on the stack track URLS) Although likely the frames from the cause likely don't make their way to the the payload? With your ErrorWithCause though, we might not need to? |
@fregante @twschiller hi, I do Product at Rollbar. I've followed up on the thread in rollbar/rollbar.js |
@twschiller great idea! Today I'll see if Rollbar supports the current concatenated stack and if it does I'll move the concatenation logic to that transform. 🎉 |
Throw block errors reported to Rollbar needs to include original stack trace. Otherwise for application errors we can't pinpoint what line caused the error
Relevant code:
Related:
The text was updated successfully, but these errors were encountered: