()
| 17 | } |
| 18 | |
| 19 | function instrumentError(): void { |
| 20 | _oldOnErrorHandler = GLOBAL_OBJ.onerror; |
| 21 | |
| 22 | // Note: The reason we are doing window.onerror instead of window.addEventListener('error') |
| 23 | // is that we are using this handler in the Loader Script, to handle buffered errors consistently |
| 24 | GLOBAL_OBJ.onerror = function ( |
| 25 | msg: string | object, |
| 26 | url?: string, |
| 27 | line?: number, |
| 28 | column?: number, |
| 29 | error?: Error, |
| 30 | ): boolean { |
| 31 | const handlerData: HandlerDataError = { |
| 32 | column, |
| 33 | error, |
| 34 | line, |
| 35 | msg, |
| 36 | url, |
| 37 | }; |
| 38 | triggerHandlers('error', handlerData); |
| 39 | |
| 40 | if (_oldOnErrorHandler) { |
| 41 | // eslint-disable-next-line prefer-rest-params |
| 42 | return _oldOnErrorHandler.apply(this, arguments); |
| 43 | } |
| 44 | |
| 45 | return false; |
| 46 | }; |
| 47 | |
| 48 | GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; |
| 49 | } |
nothing calls this directly
no test coverage detected