* Flushes pending Sentry events with a 2-second timeout and in a way that cannot create unhandled promise rejections.
()
| 114 | * Flushes pending Sentry events with a 2-second timeout and in a way that cannot create unhandled promise rejections. |
| 115 | */ |
| 116 | async function flushSafelyWithTimeout(): Promise<void> { |
| 117 | try { |
| 118 | DEBUG_BUILD && debug.log('Flushing events...'); |
| 119 | await flush(2000); |
| 120 | DEBUG_BUILD && debug.log('Done flushing events'); |
| 121 | } catch (e) { |
| 122 | DEBUG_BUILD && debug.log('Error while flushing events:\n', e); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Checks if the event is a cache event. |
no test coverage detected