(timeoutMs = 2000)
| 357 | } |
| 358 | |
| 359 | export async function flushAndCloseSentry(timeoutMs = 2000): Promise<void> { |
| 360 | if (!initialized || isSentryDisabled() || isTestEnv()) { |
| 361 | return; |
| 362 | } |
| 363 | |
| 364 | try { |
| 365 | await Sentry.close(timeoutMs); |
| 366 | } catch { |
| 367 | // Best effort during shutdown. |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | export type FlushSentryOutcome = 'skipped' | 'flushed' | 'timed_out' | 'failed'; |
| 372 |
no test coverage detected