How to use the @sentry/react-native.getCurrentHub 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 zulip / zulip-mobile / src / utils / logging.js View on Github external
} catch (err) {
      hint = { syntheticException: err };
    }
  }

  // The static API's `captureException` doesn't allow passing strings, and its
  // counterpart `captureMessage` doesn't allow passing stacktraces.
  // Fortunately, the quasi-internal "Hub" API exists, and is reasonably
  // well-documented:
  //
  // https://docs.sentry.io/development/sdk-dev/unified-api/#hub
  //
  // (There is a `captureEvent` method that allows both explicitly; but it also
  // expects a great deal of other information which we would have to
  // synthesize, and which has no user-facing documentation.)
  return getCurrentHub().captureMessage(message, level, hint);
};