我有一个拦截器,将响应模拟为return of(new HttpResponse({ status: 401, body: "Unauthorized" }));
和类似
的服务代码return this.http.post<string>(queryUrl,{ username, password },{ observe: 'response' })
.pipe(catchError(error =>{
console.log("!!!!!!error in auth");
return throwError("!!!!!!error in auth");
}
尽管我期望使用该设置,但未调用catchError方法。是意料之中的吗?