fix(tracker): 3.2.5 - merge handleError and handlErrorEvent api
This commit is contained in:
parent
810817575d
commit
ecbd3b2673
2 changed files with 6 additions and 12 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker",
|
||||
"description": "The OpenReplay tracker main package",
|
||||
"version": "3.2.4",
|
||||
"version": "3.2.5",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"replay"
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue