( error: unknown, context?: Record<string, unknown>, )
| 91 | * No-op if Sentry has not been initialized. |
| 92 | */ |
| 93 | export function captureException( |
| 94 | error: unknown, |
| 95 | context?: Record<string, unknown>, |
| 96 | ): void { |
| 97 | if (!initialized) { |
| 98 | return |
| 99 | } |
| 100 | |
| 101 | try { |
| 102 | Sentry.withScope(scope => { |
| 103 | if (context) { |
| 104 | scope.setExtras(context) |
| 105 | } |
| 106 | Sentry.captureException(error) |
| 107 | }) |
| 108 | } catch { |
| 109 | // Sentry itself failed — don't let it crash the app |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Set a tag on the current scope for grouping/filtering in Sentry. |
no outgoing calls
no test coverage detected