From a304d897fd435bda5152fdd977a407ec6f676a84 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Thu, 3 Dec 2020 01:14:51 +0100 Subject: [PATCH] added clairiefying comment --- src/app/helper/token.interceptor.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/helper/token.interceptor.ts b/src/app/helper/token.interceptor.ts index 9ea99ba..835a45a 100644 --- a/src/app/helper/token.interceptor.ts +++ b/src/app/helper/token.interceptor.ts @@ -22,13 +22,15 @@ export class TokenInterceptor implements HttpInterceptor { return next.handle(request).pipe(catchError((error: HttpErrorResponse) => { let errorMessage = ''; if (error.error instanceof ErrorEvent) { - //client error; + //client error + errorMessage = `Error: ${error.error.message}`; } else { - //server error; + //server error + if (error.status === 401) { - var urlSplit : string[] = error.url.split("/"); - if (urlSplit[3] === "users" && urlSplit[5] === "update"){ + var urlSplit : string[] = error.url.split("/"); + if (urlSplit[3] === "users" && urlSplit[5] === "update"){ // Allow user pw updates to be processed correctly errorMessage = "Das aktuelle Passwort ist inkorrekt."; } else { return this.handle401Error(request, next);