From 3e54134c30dc05160a5e9182c1a1ee1b68077566 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Tue, 2 Apr 2019 22:22:14 -0400 Subject: [PATCH] better error displaying --- src/app/services/notification.service.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/services/notification.service.ts b/src/app/services/notification.service.ts index 842b24ec..3d85645d 100644 --- a/src/app/services/notification.service.ts +++ b/src/app/services/notification.service.ts @@ -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); } }