Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add onunhandledrejection error machanism type to rejected promises #4093

Closed
romtsn opened this issue Sep 16, 2024 · 2 comments
Closed

Add onunhandledrejection error machanism type to rejected promises #4093

romtsn opened this issue Sep 16, 2024 · 2 comments

Comments

@romtsn
Copy link
Member

romtsn commented Sep 16, 2024

Description

Currently we override whatever mechanism comes from the JS sdk, see here:

if (isFatal) {
event.level = 'fatal' as SeverityLevel;
addExceptionMechanism(event, {
handled: false,
type: 'onerror',
});
} else {
event.level = 'error';
addExceptionMechanism(event, {
handled: true,
type: 'generic',
});
}

Perhaps we should preserve the original mechanism type at least, because it might be useful when filtering issues in issue stream/discover. One such case was reported with regards to onunhandledrejection type for unhandled promise rejections.

@krystofwoldrich
Copy link
Member

We create a new event in the global error handler and we set the error mechanism, there is no previous value.

onunhandledrejection is handled at:

captureException(error, {
data: { id },
originalException: error,
syntheticException: isErrorLike(error) ? undefined : createSyntheticError(),
});

And I agree we should add the correct mechanism to it.

@krystofwoldrich krystofwoldrich changed the title Preserve original error mechanism from sentry-javascript Add onunhandledrejection error machanism type to rejected promises Sep 30, 2024
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Todo in Mobile & Cross Platform SDK Oct 4, 2024
@lucas-zimerman lucas-zimerman self-assigned this Jan 16, 2025
@lucas-zimerman lucas-zimerman moved this from Todo to Needs Review in Mobile & Cross Platform SDK Jan 16, 2025
@krystofwoldrich
Copy link
Member

Done in #4457

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants