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

fix(debug): Symbolicate message and non-Error stacktraces locally #3420

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
krystofwoldrich committed Nov 27, 2023
commit 0b4490d3ffec5c50b11ee2ece56917441762f5c3
29 changes: 14 additions & 15 deletions src/js/integrations/debugsymbolicator.ts
Original file line number Diff line number Diff line change
@@ -51,18 +51,22 @@ export class DebugSymbolicator implements Integration {
return event;
}

if (event.exception
&& hint.originalException
&& typeof hint.originalException === 'object'
&& 'stack' in hint.originalException
&& typeof hint.originalException.stack === 'string') {
if (
event.exception &&
hint.originalException &&
typeof hint.originalException === 'object' &&
'stack' in hint.originalException &&
typeof hint.originalException.stack === 'string'
) {
// originalException is ErrorLike object
const symbolicatedFrames = await this._symbolicate(hint.originalException.stack);
symbolicatedFrames && this._replaceExceptionFramesInEvent(event, symbolicatedFrames);
} else if (hint.syntheticException
&& typeof hint.syntheticException === 'object'
&& 'stack' in hint.syntheticException
&& typeof hint.syntheticException.stack === 'string') {
} else if (
hint.syntheticException &&
typeof hint.syntheticException === 'object' &&
'stack' in hint.syntheticException &&
typeof hint.syntheticException.stack === 'string'
) {
// syntheticException is Error object
const symbolicatedFrames = await this._symbolicate(hint.syntheticException.stack);

@@ -177,12 +181,7 @@ export class DebugSymbolicator implements Integration {
* @param frames StackFrame[]
*/
private _replaceThreadFramesInEvent(event: Event, frames: StackFrame[]): void {
if (
event.threads &&
event.threads.values &&
event.threads.values[0] &&
event.threads.values[0].stacktrace
) {
if (event.threads && event.threads.values && event.threads.values[0] && event.threads.values[0].stacktrace) {
event.threads.values[0].stacktrace.frames = frames.reverse();
}
}
Loading