Добрий день.
Потрібно вкінці pipe() додати функцію catchError().
Добавил в конце catchError():
return next.handle(request)
.pipe(
tap(
event => {
},
err => {
if (err instanceof HttpErrorResponse) {
if (err.status == 401) {
this.loginService.logOut();
console.log('Ошибка. Код ошибки ', err.status);
}
}
}
),
catchError(err => {
throw 'Ошибка. Код ошибки ' + err.status;
})
)