@stemy/ngx-utils 19.5.4 → 19.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3429,26 +3429,21 @@ class ErrorHandlerService extends ErrorHandler {
|
|
|
3429
3429
|
this.errorMap = {};
|
|
3430
3430
|
}
|
|
3431
3431
|
handleError(error) {
|
|
3432
|
-
|
|
3433
|
-
this.universal = this.universal || this.injector.get(UniversalService);
|
|
3434
|
-
}
|
|
3435
|
-
catch (e) {
|
|
3436
|
-
return;
|
|
3437
|
-
}
|
|
3432
|
+
this.universal = this.universal || this.injector.get(UniversalService);
|
|
3438
3433
|
const date = new Date();
|
|
3439
3434
|
try {
|
|
3440
3435
|
this.errorCb = this.errorCb || this.injector.get(ERROR_HANDLER);
|
|
3441
3436
|
this.errorCb(`[${date}]: ${error.message}\n${error.stack}`);
|
|
3442
3437
|
}
|
|
3443
3438
|
catch (e) {
|
|
3444
|
-
if (this.universal.isServer) {
|
|
3439
|
+
if (!this.universal || this.universal.isServer) {
|
|
3445
3440
|
console.error(`[${date}]: ${error.message}\n${error.stack}`);
|
|
3446
3441
|
return;
|
|
3447
3442
|
}
|
|
3448
3443
|
}
|
|
3449
|
-
if (this.universal.isServer)
|
|
3444
|
+
if (!this.universal || this.universal.isServer)
|
|
3450
3445
|
return;
|
|
3451
|
-
const key = typeof btoa !== "undefined" ? btoa(
|
|
3446
|
+
const key = typeof btoa !== "undefined" ? btoa(decodeURI(encodeURIComponent(`${error.message} ${error.stack}`))) : error.message;
|
|
3452
3447
|
if (this.errorMap[key] && this.errorMap[key].getTime() > date.getTime() - 5000)
|
|
3453
3448
|
return;
|
|
3454
3449
|
this.errorMap[key] = date;
|