I have some code where i make a fetch call. This takes advantage of window.fetch api built into modern chrome / firefox.
The code sometimes hits a 401:unauthorized response. This is normal and I want it ignored, which I can do with the flow of the code. However, Chrome does show an unsightly console.error message when I try to run it.
How can I PROGRAMMATICALLY prevent this console error from showing in the dev console on all machines (i.e., no chrome dev filters or tampermonkey type plugins).
here's a sample to work off of:
fetch("http://httpstat.us/401", {requiredStatus: 'ok'})
.then(function() {
console.log("pass!");
}).catch(function() {
console.log("fail!");
});