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

Add onunhandledrejection error machanism type to rejected promises #4093

Open
romtsn opened this issue Sep 16, 2024 · 1 comment
Open

Add onunhandledrejection error machanism type to rejected promises #4093

romtsn opened this issue Sep 16, 2024 · 1 comment

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants