From 89089959af671262ebeaf062523c512cf7a31758 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Thu, 3 Dec 2020 18:34:45 +0100 Subject: [PATCH] fixed error messages --- src/app/helper/token.interceptor.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/helper/token.interceptor.ts b/src/app/helper/token.interceptor.ts index e76a61f..dd68b6a 100644 --- a/src/app/helper/token.interceptor.ts +++ b/src/app/helper/token.interceptor.ts @@ -29,6 +29,7 @@ export class TokenInterceptor implements HttpInterceptor { errorMessage = `Error: ${error.error.message}`; } else { //server error + console.log("Error: " + JSON.stringify(error)); if (error.status === 400){ switch (error.error.message) { case "Invalid refresh token!": @@ -38,6 +39,7 @@ export class TokenInterceptor implements HttpInterceptor { break; default: + errorMessage = `${error.error.message}. Error Code: ${error.status}.`; break; } @@ -50,7 +52,7 @@ export class TokenInterceptor implements HttpInterceptor { return this.handle401Error(request, next); } } else { - errorMessage = `${error.error.message}. Error Code: ${error.status}.`; + errorMessage = `${error.error.message}. Error Code: ${error.status}.`; } } this.snackBar.openSnackBar(errorMessage, "Ok", true);