fix error in javascript error handling
Budget: $10 – $30 USD
I have this simple code at the start of my ts file
//window.onerror = function() {
// alert('err')
//};
window.addEventListener('error', function (event) {
alert(event.message)
})
As you can see, I've tried both syntaxes.
In another function later on I have:
throw new Error('dummy err');
But the global listener does not fire
Chrome shows the the global listener to this line. but nothing happens
I am using React. Though I dont see React to be touching this
BTW: even regular errors, that are thrown lets say by fetch which get back 500 errors, are also not caught by the global handler.
I ill need to you to connect to my screen via zoom and fix the issue
PS: the question is also here
https://stackoverflow.com/questions/69146096/how-to-ensure-window-onerror-to-fire-for-all-errors
Thanks
//window.onerror = function() {
// alert('err')
//};
window.addEventListener('error', function (event) {
alert(event.message)
})
As you can see, I've tried both syntaxes.
In another function later on I have:
throw new Error('dummy err');
But the global listener does not fire
Chrome shows the the global listener to this line. but nothing happens
I am using React. Though I dont see React to be touching this
BTW: even regular errors, that are thrown lets say by fetch which get back 500 errors, are also not caught by the global handler.
I ill need to you to connect to my screen via zoom and fix the issue
PS: the question is also here
https://stackoverflow.com/questions/69146096/how-to-ensure-window-onerror-to-fire-for-all-errors
Thanks