How to use the @sentry/react-native.withScope function in @sentry/react-native

To help you get started, we’ve selected a few @sentry/react-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jolocom / smartwallet-app / src / lib / errors.ts View on Github external
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)
  })
}