Sentry: add return types, return eventId from `captureSentryException`

environments/review-main-yi2y9f/deployments/4227
Alex Gleason 2023-10-21 14:21:21 -05:00
rodzic a7d78d0935
commit c5d527a667
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -48,7 +48,7 @@ async function startSentry(dsn: string): Promise<void> {
}
/** Associate the account with Sentry events. */
async function setSentryAccount(account: Account) {
async function setSentryAccount(account: Account): Promise<void> {
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<void> {
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<void> {
async function captureSentryException (
exception: any,
captureContext?: CaptureContext | undefined,
): Promise<string> {
const Sentry = await import('@sentry/react');
Sentry.captureException(exception, captureContext);
return Sentry.captureException(exception, captureContext);
}
export { startSentry, setSentryAccount, unsetSentryAccount, captureSentryException };