-
-
Notifications
You must be signed in to change notification settings - Fork 478
feat(callbacks): [Callback Errors 10] Add opt-in strict callback mode #6173
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: fix/callback-error-handling-custom-callbacks
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,7 +116,11 @@ private boolean isMaskingEnabled() { | |
| if (!beforeCaptureCallback.execute(event, hint, shouldDebounce)) { | ||
| return event; | ||
| } | ||
| } catch (Exception e) { | ||
| } catch (Exception | Error e) { | ||
| io.sentry.util.CallbackUtils.rethrowIfStrictCallbackMode(options, e); | ||
| if (e instanceof Error) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I always agree with narrowing the number of swallowed errors. That being said, this would be a breaking change to consumers since we will now throw an exception that we previously did not catch. That's fine if we do this in a major, otherwise if we want to do this in a minor, we should discuss! Also, if the goal of this is to rethrow unrecoverable errors, we created |
||
| throw (Error) e; | ||
| } | ||
| options | ||
| .getLogger() | ||
| .log( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,7 @@ public boolean dispatchTouchEvent(final @Nullable MotionEvent motionEvent) { | |
| try { | ||
| handleTouchEvent(copy); | ||
| } catch (Throwable e) { | ||
| io.sentry.util.ExceptionUtils.maybeRethrow(e); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: import (here and elsewhere in the PR) |
||
| if (options != null) { | ||
| options.getLogger().log(SentryLevel.ERROR, "Error dispatching touch event", e); | ||
| } | ||
|
|
||
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.
what does this mean?
It just isn't clear since it seems to contradict the previous sentence. maybe adding "Otherwise..." would help clarify.