( error: unknown, context?: Record<string, unknown> )
| 51 | * enqueues to the in-memory transport. |
| 52 | */ |
| 53 | export const captureError = async ( |
| 54 | error: unknown, |
| 55 | context?: Record<string, unknown> |
| 56 | ): Promise<void> => { |
| 57 | if (env.SENTRY_DSN === "") { |
| 58 | return; |
| 59 | } |
| 60 | |
| 61 | Sentry.captureException( |
| 62 | error, |
| 63 | context !== undefined ? { extra: context } : undefined |
| 64 | ); |
| 65 | |
| 66 | try { |
| 67 | await Sentry.flush(SENTRY_FLUSH_TIMEOUT_MS); |
| 68 | } catch { |
| 69 | /* swallowed: flush failure shouldn't take down a fatal-handler path. */ |
| 70 | } |
| 71 | }; |
no outgoing calls
no test coverage detected