HttpClient 有没有办法从浏览器控制台中删除错误消息?
我当前的代码如下所示:
getStuff(stuffId: string): Observable<Stuff[]> {
return this.httpClient.get<Stuff[]>(this.stuff() + stuffId + '/stuff/').pipe(
catchError((err) => {
console.log(err.status);
if (err.status === 404) {
console.log('Not found');
}
})
);
}
if 语句中的我的 console.log('Not found') 被执行,但它仍然向控制台抛出标准错误。
我的目标:控制台中没有红色:)
更新:
这些错误不是在 Firefox 中引发的,而是在 Google Chrome 中引发的。为什么..?