How to use the @sentry/react-native.captureException 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 celo-org / celo-monorepo / packages / mobile / src / utils / keyStore.ts View on Github external
export async function getKey(key: string) {
  try {
    Logger.debug(TAG, `Getting key ${key} from keystore`)
    const value = await RNSecureKeyStore.get(key)
    Logger.debug(TAG, `Key ${key} retrieved from keystore`)
    return value
  } catch (error) {
    Logger.error(TAG, `Error getting key ${key} from keystore`, error)
    // Capturing error in sentry for now as we debug backup key issue
    Sentry.captureException(error)
    throw error
  }
}
github mattermost / mattermost-mobile / app / utils / sentry / index.js View on Github external
export function captureExceptionWithoutState(err, logger) {
    if (!Config.SentryEnabled) {
        return;
    }

    if (err && logger) {
        try {
            Sentry.captureException(err, {logger});
        } catch (error) {
            // do nothing...
        }
    }
}
github celo-org / celo-monorepo / packages / mobile / src / utils / keyStore.ts View on Github external
export async function setKey(key: string, value: string) {
  try {
    Logger.debug(TAG, `Setting key ${key} in keystore`)
    // TODO(Rossy + Jean): Revisit this accessible setting
    await RNSecureKeyStore.set(key, value, {
      accessible: ACCESSIBLE.WHEN_UNLOCKED,
    })
    Logger.debug(TAG, `Key ${key} set in keystore`)
  } catch (error) {
    Logger.error(TAG, `Error setting key ${key} in keystore`, error)
    // Capturing error in sentry for now as we debug backup key issue
    Sentry.captureException(error)
    throw error
  }
}
github OriginProtocol / origin / mobile / src / PushNotifications.js View on Github external
const authClient = new AuthClient({
      authServer:
        this.props.config.authServer || 'https://auth.originprotocol.com',
      disablePersistence: true
    })

    try {
      const tokenData = await authClient.getTokenWithSignature(
        wallet.activeAccount.address,
        signature,
        payload
      )

      return tokenData.authToken
    } catch (error) {
      Sentry.captureException(error)
      console.warn('Failed to generate auth token', error)
    }
    return null
  }
github StoDevX / AAO-React-Native / source / views / settings / screens / overview / developer.js View on Github external
sendSentryException = () => {
		Sentry.captureException(new Error('Debug Exception'))
		this.showSentryAlert()
	}
	showSentryAlert = () => {
github rainbow-me / rainbow / src / redux / gas.js View on Github external
.catch(error => {
            dispatch({
              payload: fallbackGasPrices,
              type: GAS_PRICES_FAILURE,
            });
            captureException(error);
            fetchReject(error);
          });
      });
github celo-org / celo-monorepo / packages / mobile / index.js View on Github external
const customErrorHandler = (e, isFatal) => {
  if (sentryEnabled) {
    Sentry.captureException(e)
  }
  Logger.error('RootErrorHandler', `Unhandled error. isFatal: ${isFatal}`, e)
  defaultErrorHandler(e, isFatal)
}
ErrorUtils.setGlobalHandler(customErrorHandler)
github listenzz / react-native-engineering / app / App.tsx View on Github external
.catch(e => {
        Sentry.captureException(e)
      })
  }
github jolocom / smartwallet-app / src / lib / errors.ts View on Github external
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)
  })
}
github mattermost / mattermost-mobile / app / utils / sentry / index.js View on Github external
capture(() => {
        Sentry.captureException(error, {logger});
    }, store);
}