Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function reportError(report: ErrorReport) {
Sentry.withScope(scope => {
if (report.error instanceof AppError && report.error.origError) {
scope.setExtras({
AppError: report.error.message,
UserError: report.userError,
UserDescription: report.userDescription,
UserContact: report.userContact,
sendPrivateData: report.sendPrivateData,
})
report.error = report.error.origError
}
Sentry.captureException(report.error)
})
}