diff --git a/tracker/tracker/package.json b/tracker/tracker/package.json index 8c6f6c172..1ed351baf 100644 --- a/tracker/tracker/package.json +++ b/tracker/tracker/package.json @@ -1,7 +1,7 @@ { "name": "@openreplay/tracker", "description": "The OpenReplay tracker main package", - "version": "3.2.4", + "version": "3.2.5", "keywords": [ "logging", "replay" diff --git a/tracker/tracker/src/main/index.ts b/tracker/tracker/src/main/index.ts index e56eab6ec..79e2cbee8 100644 --- a/tracker/tracker/src/main/index.ts +++ b/tracker/tracker/src/main/index.ts @@ -225,18 +225,12 @@ export default class API { } } - handleError = (e: Error) => { - if (e instanceof Error && this.app !== null) { + handleError = (e: Error | ErrorEvent | PromiseRejectionEvent) => { + if (this.app === null) { return; } + if (e instanceof Error) { this.app.send(getExceptionMessage(e, [])); - } - } - - handleErrorEvent = (e: ErrorEvent | PromiseRejectionEvent) => { - if ( - (e instanceof ErrorEvent || - ('PromiseRejectionEvent' in window && e instanceof PromiseRejectionEvent) - ) && - this.app !== null + } else if (e instanceof ErrorEvent || + ('PromiseRejectionEvent' in window && e instanceof PromiseRejectionEvent) ) { const msg = getExceptionMessageFromEvent(e); if (msg != null) {