Merge stack traces
See original GitHub issueTangentially related to this module, but is there any easy way to join the current stack trace (e.g. Error.captureStackTrace
) with the the serialized error’s? Throwing a pre-existing error as-is may be confusing because its stack trace does not contain the current throw
line’s stack.
Is the modern way to handle this via .cause
?
const current = new Error('Got an error')
current.cause = deserializeError(remoteError);
throw current;
Unfortunately I think it’s not going to be well-supported for quite a while.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Merging stack traces in rethrown errors - javascript
The idea is the same: Wrapping errors in errors. However it is much simpler. It has less features, but also works in the...
Read more >Merge stack traces into a single log event in Open Liberty 22.0 ...
When a stack trace is logged in Open Liberty, typically from Throwable.printStackTrace() calls from the application, you can now output the ...
Read more >Merge exception stack trace into call stack
- i need to manualy "parse" StackTrace and determine source of given exception. Visual Studiovisual studio. MB.
Read more >Merge Multiline Java Stack trace via syslog - Splunk Community
Merge Multiline Java Stack trace via syslog ... I'm having a heck of a time figuring out the best way to get splunk...
Read more >filebeat merged java stack trace information is truncated #30020
filebeat collects java stack trace logs and uses time as a condition for merging lines. But I found that filebeat will not merge...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hopefully, that will come sooner than later. People will start using “cause” and there will be demand.
No good way other than string handling: https://github.com/sindresorhus/got/blob/d4e34c7625c1c7000fd1b9af00e743669f83c83a/source/core/errors.ts#L55-L67
Error#cause
is really the way to do this.