-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(record): Allow callbackWrapper
to attach a __source__
property to exceptions
#111
Conversation
…ty to exceptions Allow `callbackWrapper` to attach an optional `__source__` property to a caught exception. This will allow downstream errorHandlers to decide to re-throw an exception based on the source type.
if (errorSource) { | ||
error.__source__ = errorSource; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this only happens if we have errorHandler
defined, this probably only affects us. I opted to make this generic so that errorHandler
be the source of truth vs attaching a meta property like __allowThrow__
NOTE: This requires a bump to rrweb library Fixes an issue where the Replay integration can potentially break applications that use `styled-components`. `styled-components` [relies on an exception being throw](https://github.com/styled-components/styled-components/blob/b7b374bb1ceff1699f7035b15881bc807110199a/packages/styled-components/src/sheet/Tag.ts#L32-L40) for CSS rules that are not supported by the browser engine. However, our SDK suppresses any exceptions thrown from within rrweb, so `styled-components` assumes that an unsupported rule was inserted successfully and increases a rule index, which causes following inserted rules to fail due to an out-of-bounds error. getsentry/rrweb#111 introduces a change the adds metadata to exceptions that occur when calling `insertRule`, and this PR will re-throw those exceptions that will then bubble up to `styled-components`. Fixes #9170
Actually, we probably don't need this as we should just re-throw error in our Replay SDK. |
NOTE: This requires a bump to rrweb library Fixes an issue where the Replay integration can potentially break applications that use `styled-components`. `styled-components` [relies on an exception being throw](https://github.com/styled-components/styled-components/blob/b7b374bb1ceff1699f7035b15881bc807110199a/packages/styled-components/src/sheet/Tag.ts#L32-L40) for CSS rules that are not supported by the browser engine. However, our SDK suppresses any exceptions thrown from within rrweb, so `styled-components` assumes that an unsupported rule was inserted successfully and increases a rule index, which causes following inserted rules to fail due to an out-of-bounds error. getsentry/rrweb#111 introduces a change the adds metadata to exceptions that occur when calling `insertRule`, and this PR will re-throw those exceptions that will then bubble up to `styled-components`. Fixes #9170
Allow
callbackWrapper
to attach an optional__source__
property to a caught exception. This will allow downstream errorHandlers to decide to re-throw an exception based on the source type.Needed to address getsentry/sentry-javascript#9170