Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sendReport = () => {
const { error, errorInfo, eventId } = this.state
if (!Environment.isTest) {
/* Send the crash report to Sentry. */
Sentry.withScope(scope => {
scope.setExtra(errorInfo)
this.setState({ eventId: Sentry.captureException(error) })
})
/* Collect user feedback as follow up. */
Sentry.showReportDialog({ eventId })
} else {
logger.error(`Error: ${error}`)
logger.error(`ErrorInfo: ${JSON.stringify(errorInfo)}`)
}
}
beforeSend(event) {
// Check if it is an exception, if so, show the report dialog
if (event.exception) {
Sentry.showReportDialog();
}
return event;
}
});
beforeSend(event) {
// Check if it is an exception, if so, show the report dialog
if (event.exception) {
Sentry.showReportDialog();
}
return event;
}
});