-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove unhandledrejection listener and provide setError in a context (#…
…21) * remove unhandledrejection listener and provide setError in a context Listening to all unhandledrejection events is not ideal for setting the error screen, as these events can also come from non-app code, which leads to the error screen displaying for non-issues from third-party code. This updates the ErrorBoundary to remove the listener completely, and provide setError as the preferred method for handling async errors where they occur. * add comment describing hook * this did not need to be renamed * notify sentry within the hook * tidy * export the error context and hook * set the event id from captureException
- Loading branch information
Showing
15 changed files
with
198 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,12 @@ export const Default = () => { | |
Promise.reject('Test error for modal'); | ||
}, []); | ||
|
||
const [show, setShow] = React.useState(true); | ||
|
||
return <ErrorBoundary sentryDsn="https://[email protected]/0"> | ||
<ErrorModal | ||
onModalClose={() => undefined} | ||
show={true} | ||
onModalClose={() => setShow(false)} | ||
show={show} | ||
/> | ||
</ErrorBoundary>; | ||
} |
Oops, something went wrong.