Skip to content

Commit

Permalink
management of objects in error output for coe
Browse files Browse the repository at this point in the history
  • Loading branch information
PandoraQS committed Jul 26, 2024
1 parent 092106e commit 37401da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/angular2-app/coe/coe-simulation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class CoeSimulationService implements OnDestroy {
}).catch(err => this.errorHandler(err));
}

errorHandler(err: Response, stopped?: boolean) {
errorHandler(err: { error?: string, statusText?: string, status?: number }, stopped?: boolean) {
console.warn(err);
if (stopped) {
this.progress = 0;
Expand All @@ -187,9 +187,10 @@ export class CoeSimulationService implements OnDestroy {
this.progress = 0;
console.log("err: ", err);
if('error' in err){
this.errorReport(true, "Error: " + err.statusText + " - " + err.error + ". Check CoE Log for more details.");
let errorMessage = typeof err.error === 'string' ? err.error : '';
this.errorReport(true, "Error: " + err.statusText + (errorMessage ? " - " + errorMessage : "") + ". Check CoE Server and/or CoE Log for more details.");
} else{
this.errorReport(true, "Error: " + err.statusText);
this.errorReport(true, "Error: " + err.statusText);
}
}
}
Expand Down

0 comments on commit 37401da

Please sign in to comment.