from Sentry Memo
Sentry User Feedback
<Sentry.ErrorBoundary fallback="An error has occurred" showDialog>Sentry.init({...
beforeSend(event, hint) {
// Check if it is an exception, and if so, show the report dialog
if (event.exception) {
Sentry.showReportDialog({ eventId: event.event_id });
}
return event;
},
});
- In develop, there's a feedback screen below the error screen.
- I'm getting a duplicate ID warning.
- There are two feedback screens out there to begin with.
- I thought it was a duplicate of showDialog, but turning it off doesn't change it.
- Two errors with different error IDs or time stamps
- Contents are the same
- The event count display on the Sentry is also increasing by 2.
- Does the error boundary cause it to come up twice? I thought so, but it has nothing to do with whether or not
- →I decided to do the process on my own to display only once.
consideration
error boundary is a React component that catches JavaScript errors in its own child component tree, logs the error, and displays a fallback UI in place of the crashed component tree.
error boundary does not catch the following errors
Event Handler (detail)
Asynchronous code (e.g., setTimeout or requestAnimationFrame callbacks)
This page is auto-translated from [/nishio/Sentryでエラー時にUser Feedbackのフォームを出す](https://scrapbox.io/nishio/Sentryでエラー時にUser Feedbackのフォームを出す) using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.