Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} 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);
};