update more checking error
This commit is contained in:
parent
8221183630
commit
edabaf7396
3 changed files with 17 additions and 6 deletions
|
|
@ -8,7 +8,7 @@ import {
|
|||
} from '@angular/common/http';
|
||||
import { Observable, catchError, retry, throwError } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class ErrorInterceptor implements HttpInterceptor {
|
||||
constructor() {}
|
||||
|
||||
|
|
@ -19,11 +19,7 @@ export class ErrorInterceptor implements HttpInterceptor {
|
|||
return next.handle(request).pipe(
|
||||
catchError((error) => {
|
||||
if (error instanceof HttpErrorResponse) {
|
||||
if (error.status === 401) {
|
||||
return next.handle(request);
|
||||
}
|
||||
}
|
||||
|
||||
return throwError(() => error);
|
||||
})
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue