Catching “Failed to load resource” when using the Fetch API
问题 I'm trying to catch a bunch of errors related to the same origin policy when using the Fetch API but without any success: window.onerror = (message, file, line, col, error) => console.log(error) window.addEventListener('error', (error) => console.log(error)) try { fetch('https://www.bitstamp.net/api/ticker/').catch(e => { console.log('Caugth error:') console.log(e) console.log(JSON.stringify(e)) }) } catch (e) { console.log('try-catch') console.log(e) } The errors I want to catch only appear