From 2df4ce991a16255b3c3c759d813c624c0731fee2 Mon Sep 17 00:00:00 2001 From: Lukas Metzger Date: Sun, 29 Apr 2018 19:57:14 +0200 Subject: [PATCH] Fixed exeption handling for 403 errors --- frontend/src/app/services/http.service.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/services/http.service.ts b/frontend/src/app/services/http.service.ts index 84fac45..47ba378 100644 --- a/frontend/src/app/services/http.service.ts +++ b/frontend/src/app/services/http.service.ts @@ -46,7 +46,9 @@ export class HttpService { headers: this.buildHeaders() })).data; } catch (e) { - this.handleException(e); + if (!await this.handleException(e)) { + throw e; + } } } @@ -59,7 +61,9 @@ export class HttpService { headers: this.buildHeaders() })).data; } catch (e) { - this.handleException(e); + if (!await this.handleException(e)) { + throw e; + } } } @@ -72,7 +76,9 @@ export class HttpService { headers: this.buildHeaders() })).data; } catch (e) { - this.handleException(e); + if (!await this.handleException(e)) { + throw e; + } } } @@ -84,7 +90,9 @@ export class HttpService { headers: this.buildHeaders() })).data; } catch (e) { - this.handleException(e); + if (!await this.handleException(e)) { + throw e; + } } } @@ -121,8 +129,10 @@ export class HttpService { this.gs.isLoggedIn = false; this.router.navigate(['/']); + + return true; } else { - throw e; + return false; } } }