better error displaying

This commit is contained in:
Nicolas Constant 2019-04-02 22:22:14 -04:00
parent 29aa5c7bbe
commit 3e54134c30
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 6 additions and 5 deletions

View File

@ -14,11 +14,12 @@ export class NotificationService {
this.notifactionStream.next(newNotification);
}
public notifyHttpError(err: HttpErrorResponse){
console.error(err);
console.error(err.message);
// let message = `${err.status}: ${err.statusText}`;
let message = `${err.statusText}`;
public notifyHttpError(err: HttpErrorResponse){
let message = 'Oops, Unknown Error' ;
try{
message = `Oops, Error ${err.status}`;
console.error(err.message);
} catch(err){}
this.notify(message, true);
}
}