-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Closed as not planned
Copy link
Description
Problem Statement
When attachStacktrace is enabled, captureMessage calls don't set the stack trace.
Related issue getsentry/sentry-react-native#2131
Code:
sentry-javascript/packages/browser/src/eventbuilder.ts
Lines 275 to 282 in 28c464d
| if (attachStacktrace && syntheticException) { | |
| const frames = parseStackFrames(stackParser, syntheticException); | |
| if (frames.length) { | |
| event.exception = { | |
| values: [{ value: input, stacktrace: { frames } }], | |
| }; | |
| } | |
| } |
Since
syntheticException is null, it does not set the stack trace.Ideally, there will be an
else branch that checks the attachStacktrace flag and sets the stack trace in the threads interface.
Solution Brainstorm
When attachStacktrace is enabled, captureMessage contains the stack trace in the threads section since there's no exception to attach the stack trace to.
Mobile SDKs already do it.