more flexible error interceptor
This commit is contained in:
parent
4632bde685
commit
ccbe4eace5
@ -12,7 +12,9 @@ export class ServerErrorInterceptor implements HttpInterceptor {
|
||||
return next.handle(req).pipe(
|
||||
map((event: HttpEvent<any>) => event),
|
||||
catchError((error: HttpErrorResponse) => {
|
||||
if ([0, 500].includes(error.status)) this._errorService.set(error);
|
||||
if (error.status >= 500 || error.status === 0) {
|
||||
this._errorService.set(error);
|
||||
}
|
||||
return throwError(error);
|
||||
})
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user