Skip to content

Commit 7702b0c

Browse files
committed
fix: error handler propogation
1 parent 488f6f2 commit 7702b0c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/app/interceptors/error.interceptor.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
22
import { Injectable } from '@angular/core';
33
import { Router } from '@angular/router';
4-
import { Observable, throwError } from 'rxjs';
4+
import { EMPTY, Observable, of, throwError } from 'rxjs';
55
import { catchError } from 'rxjs/operators';
66
import { RouteNames } from '../models/enums';
77
import { SnackbarService } from '../services/snackbar/snackbar.service';
@@ -27,6 +27,9 @@ export class ErrorInterceptor implements HttpInterceptor {
2727

2828
// Redirect to login page
2929
this.router.navigate([`/${RouteNames.LANDINGPAGE_LOGIN_BASEROUTE}`]);
30+
31+
// do not propagate the error to the next interceptor
32+
return EMPTY;
3033
}
3134
return throwError(err);
3235
})

src/app/pages/participant/participant-dashboard/participant-studies/participant-study/participant-study.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export class ParticipantStudyComponent implements OnInit, OnDestroy {
111111
)
112112
.subscribe(
113113
(_res) => {},
114-
(err: HttpStatus) => {
115-
this.snackbar.openErrorSnackbar(err.message);
114+
(err) => {
115+
this.taskManager.handleErr(err);
116116
}
117117
)
118118
.add(() => {

0 commit comments

Comments
 (0)