Skip to content

If attachStacktrace is enabled, captureMessage should include the stack trace in the threads interface #5879

@marandaneto

Description

@marandaneto

Problem Statement

When attachStacktrace is enabled, captureMessage calls don't set the stack trace.
Related issue getsentry/sentry-react-native#2131

Code:

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions