Catching All Promise Errors

Recently I was looking into monitoring static websites and it got me thinking about global error handling. There’s a good chance that you’ve come across the onerror global handler that’s triggered when an error happens and there’s no try/catch around it. But how does this work when working with Promises?
Promise Error Handling Let’s take this example:
1 2 3 4 5 6 7 8 9 10 11 function getJson() { return fetch(‘https://url/json’) .

Recently I was looking into monitoring static websites and it got me thinking about global error handling. There’s a good chance that you’ve come across the onerror global handler that’s triggered when an error happens and there’s no try/catch around it. But how does this work when working with Promises? Promise Error Handling Let’s take this example: 1 2 3 4 5 6 7 8 9 10 11 function getJson() { return fetch('https://url/json') .
Print Share Comment Cite Upload Translate
CITATION GOES HERE CITATION GOES HERE
Select a language: