Hide fetch errors [duplicate]

谁说我不能喝 提交于 2019-12-02 01:56:46

问题


I've noticed that Chrome is logging all 4xx errors met by fetch while other browsers (at least Safari and Chrome) do not log them.

How can I prevent Chrome fetch from logging to console http request errors like 400 and 422?


回答1:


You can use the "Hide network messages" option to hide these in the Console. You will still be able to see the error in the Network tab.

Before

After

If you want to filter particular error codes, you could use a regular expression to do this. The following should filter out any messages that contain 4, followed by 2 digits, followed by a space character, followed by ().

^((?!4\d{2}\s\(\)).)*$


来源:https://stackoverflow.com/questions/39270513/hide-fetch-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!