Jelajahi Sumber

Fixed exeption handling for 403 errors

Lukas Metzger 7 tahun lalu
induk
melakukan
2df4ce991a
1 mengubah file dengan 15 tambahan dan 5 penghapusan
  1. 15 5
      frontend/src/app/services/http.service.ts

+ 15 - 5
frontend/src/app/services/http.service.ts

@@ -46,7 +46,9 @@ export class HttpService {
                 headers: this.buildHeaders()
                 headers: this.buildHeaders()
             })).data;
             })).data;
         } catch (e) {
         } catch (e) {
-            this.handleException(e);
+            if (!await this.handleException(e)) {
+                throw e;
+            }
         }
         }
     }
     }
 
 
@@ -59,7 +61,9 @@ export class HttpService {
                 headers: this.buildHeaders()
                 headers: this.buildHeaders()
             })).data;
             })).data;
         } catch (e) {
         } catch (e) {
-            this.handleException(e);
+            if (!await this.handleException(e)) {
+                throw e;
+            }
         }
         }
     }
     }
 
 
@@ -72,7 +76,9 @@ export class HttpService {
                 headers: this.buildHeaders()
                 headers: this.buildHeaders()
             })).data;
             })).data;
         } catch (e) {
         } catch (e) {
-            this.handleException(e);
+            if (!await this.handleException(e)) {
+                throw e;
+            }
         }
         }
     }
     }
 
 
@@ -84,7 +90,9 @@ export class HttpService {
                 headers: this.buildHeaders()
                 headers: this.buildHeaders()
             })).data;
             })).data;
         } catch (e) {
         } catch (e) {
-            this.handleException(e);
+            if (!await this.handleException(e)) {
+                throw e;
+            }
         }
         }
     }
     }
 
 
@@ -121,8 +129,10 @@ export class HttpService {
             this.gs.isLoggedIn = false;
             this.gs.isLoggedIn = false;
 
 
             this.router.navigate(['/']);
             this.router.navigate(['/']);
+
+            return true;
         } else {
         } else {
-            throw e;
+            return false;
         }
         }
     }
     }
 }
 }