@esfaenza/core 19.2.190 → 19.2.191

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.
@@ -7,10 +7,10 @@ import * as i2 from '@angular/common/http';
7
7
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
8
8
  import * as i1$1 from '@angular/router';
9
9
  import { Router } from '@angular/router';
10
+ import * as i5 from '@esfaenza/extensions';
11
+ import { MessageService, InboundMessageTypes, CallResult } from '@esfaenza/extensions';
10
12
  import * as i1$2 from '@esfaenza/localizations';
11
13
  import { LocalizationService } from '@esfaenza/localizations';
12
- import * as i5 from '@esfaenza/extensions';
13
- import { InboundMessageTypes, MessageService, CallResult } from '@esfaenza/extensions';
14
14
  import { HTTPService } from '@esfaenza/httpservice';
15
15
  import * as i4 from '@esfaenza/preferences';
16
16
  import { CachePersistor, PreferencesPersistor } from '@esfaenza/preferences';
@@ -1095,6 +1095,8 @@ class APPErrorHandler {
1095
1095
  handleError(error) {
1096
1096
  if (this.router == null)
1097
1097
  this.router = this.injector.get(Router);
1098
+ if (this.msgsExts == null)
1099
+ this.msgsExts = this.injector.get(MessageService);
1098
1100
  //Ignoro eventuali errori di javascript quando il redirect è attivo
1099
1101
  if (myconfig && myconfig.redirectInProgress) {
1100
1102
  console.log("Javascript error on redirect in progress, ignoring this event");
@@ -1110,8 +1112,10 @@ class APPErrorHandler {
1110
1112
  newError = error.stack && error.stack.length > 1000 ? error.stack.substring(0, 999) + "[...]" : error.stack;
1111
1113
  if (!newError)
1112
1114
  newError = JSON.stringify(error);
1113
- var pars = { errorMessage: this.b64EncodeUnicode(newError), fromUrl: this.router.url };
1114
- this.router.navigate([`err/9999`, pars]);
1115
+ if (newError.includes("Failed to fetch dynamically imported module"))
1116
+ this.msgsExts.simpleError("L'applicativo non risulta sincronizzato con il Server. Si prega di ricaricare la pagina");
1117
+ else
1118
+ this.router.navigate([`err/9999`, { errorMessage: this.b64EncodeUnicode(newError), fromUrl: this.router.url }]);
1115
1119
  }
1116
1120
  b64EncodeUnicode(str) {
1117
1121
  // first we use encodeURIComponent to get percent-encoded UTF-8,
@@ -1464,6 +1468,10 @@ class HTTPServiceExtensions {
1464
1468
  this.msgs.simpleError(this.lc.loc("Il Server sembra essere offline, prova a ricaricare la pagina"));
1465
1469
  this.as.handlingError = false;
1466
1470
  }
1471
+ else if (status == 0) {
1472
+ this.msgs.simpleError(this.lc.loc("Impossibile connettersi alla suite Jace. Controllare le impostazioni di rete e riprovare. Se il problema persiste, provare a ricaricare la pagina"));
1473
+ this.as.handlingError = false;
1474
+ }
1467
1475
  else if (status == 542) {
1468
1476
  this.msgs.simpleError(text);
1469
1477
  this.as.handlingError = false;