fix(tracker): 3.2.5 - merge handleError and handlErrorEvent api

This commit is contained in:
ShiKhu 2021-08-27 09:54:52 +03:00
parent 810817575d
commit ecbd3b2673
2 changed files with 6 additions and 12 deletions

View file

@ -1,7 +1,7 @@
{
"name": "@openreplay/tracker",
"description": "The OpenReplay tracker main package",
"version": "3.2.4",
"version": "3.2.5",
"keywords": [
"logging",
"replay"

View file

@ -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) {