Skip to content
Snippets Groups Projects
Commit a198c86b authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FEAT #15550 TIME 0:03 add handleErrors to catchError http request + remove them from interceptor

parent 5858ba96
No related branches found
No related tags found
No related merge requests found
...@@ -69,6 +69,7 @@ export class CheckConnectionComponent implements OnInit { ...@@ -69,6 +69,7 @@ export class CheckConnectionComponent implements OnInit {
}), }),
finalize(() => this.loadingTest = false), finalize(() => this.loadingTest = false),
catchError((err: any) => { catchError((err: any) => {
this.notificationService.handleErrors(err);
return of(false); return of(false);
}) })
).subscribe(); ).subscribe();
...@@ -87,6 +88,7 @@ export class CheckConnectionComponent implements OnInit { ...@@ -87,6 +88,7 @@ export class CheckConnectionComponent implements OnInit {
}), }),
finalize(() => this.loadingTest = false), finalize(() => this.loadingTest = false),
catchError((err: any) => { catchError((err: any) => {
this.notificationService.handleErrors(err);
return of(false); return of(false);
}) })
).subscribe(); ).subscribe();
......
...@@ -391,6 +391,7 @@ export class DocumentComponent implements OnInit { ...@@ -391,6 +391,7 @@ export class DocumentComponent implements OnInit {
setTimeout(() => { setTimeout(() => {
this.load.dismiss(); this.load.dismiss();
}, 200); }, 200);
this.notificationService.handleErrors(err);
this.router.navigate(['/home']); this.router.navigate(['/home']);
return of(false); return of(false);
}) })
...@@ -434,6 +435,7 @@ export class DocumentComponent implements OnInit { ...@@ -434,6 +435,7 @@ export class DocumentComponent implements OnInit {
}), }),
catchError((err: any) => { catchError((err: any) => {
this.load.dismiss(); this.load.dismiss();
this.notificationService.handleErrors(err);
this.router.navigate(['/home']); this.router.navigate(['/home']);
return of(false); return of(false);
}) })
...@@ -445,6 +447,7 @@ export class DocumentComponent implements OnInit { ...@@ -445,6 +447,7 @@ export class DocumentComponent implements OnInit {
}), }),
catchError((err: any) => { catchError((err: any) => {
this.load.dismiss(); this.load.dismiss();
this.notificationService.handleErrors(err);
this.router.navigate(['/home']); this.router.navigate(['/home']);
return of(false); return of(false);
}) })
......
...@@ -79,7 +79,6 @@ export class AuthInterceptor implements HttpInterceptor { ...@@ -79,7 +79,6 @@ export class AuthInterceptor implements HttpInterceptor {
catchError(err => { catchError(err => {
// Disconnect user if bad token process // Disconnect user if bad token process
if (err.status === 401) { if (err.status === 401) {
this.notificationService.handleErrors(err);
this.logout(); this.logout();
return EMPTY; return EMPTY;
} }
...@@ -91,7 +90,6 @@ export class AuthInterceptor implements HttpInterceptor { ...@@ -91,7 +90,6 @@ export class AuthInterceptor implements HttpInterceptor {
catchError(err => { catchError(err => {
// Disconnect user if bad token process // Disconnect user if bad token process
if (err.status === 401) { if (err.status === 401) {
this.notificationService.handleErrors(err);
this.logout(); this.logout();
} }
return EMPTY; return EMPTY;
...@@ -118,7 +116,6 @@ export class AuthInterceptor implements HttpInterceptor { ...@@ -118,7 +116,6 @@ export class AuthInterceptor implements HttpInterceptor {
} }
}); });
} }
this.notificationService.handleErrors(error);
const response = new HttpErrorResponse({ const response = new HttpErrorResponse({
error: error.error, error: error.error,
status: error.status, status: error.status,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment