diff --git a/src/sentry.ts b/src/sentry.ts index 31cec656b..ae74e05ab 100644 --- a/src/sentry.ts +++ b/src/sentry.ts @@ -48,7 +48,7 @@ async function startSentry(dsn: string): Promise { } /** Associate the account with Sentry events. */ -async function setSentryAccount(account: Account) { +async function setSentryAccount(account: Account): Promise { const Sentry = await import('@sentry/react'); Sentry.setUser({ @@ -59,15 +59,18 @@ async function setSentryAccount(account: Account) { } /** Remove the account from Sentry events. */ -async function unsetSentryAccount() { +async function unsetSentryAccount(): Promise { const Sentry = await import('@sentry/react'); Sentry.setUser(null); } /** Capture the exception and report it to Sentry. */ -async function captureSentryException (exception: any, captureContext?: CaptureContext | undefined): Promise { +async function captureSentryException ( + exception: any, + captureContext?: CaptureContext | undefined, +): Promise { const Sentry = await import('@sentry/react'); - Sentry.captureException(exception, captureContext); + return Sentry.captureException(exception, captureContext); } export { startSentry, setSentryAccount, unsetSentryAccount, captureSentryException }; \ No newline at end of file