D
Size: a a a
D
A
@Injectable()
export class ServerErrorInterceptor implements HttpInterceptor {
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(request).pipe(
retry(1),
catchError((error: HttpErrorResponse) => {
if (error.status === 401) {
// refresh token
} else {
return throwError(error);
}
})
);
}
}
ТЖ
A
AI
AK
🧤K
🧤K
FL
IL
РЭ
РЭ
R
РЭ
AK
РЭ
AK
РЭ
РЭ
АП