If I’m working on more UI-type stuff, things can fail silently in quite confusing ways… because I don’t have dev tools open, because I’m essentially already using an IDE. But that IDE isn’t showing me some errors–I think because they are happening in event handlers and such, and so aren’t directly run by the engine.
So I was thinking if window.onerror was monitored those could be caught too.
…
On a related note, I noticed that if you throw "a message"
(I’m lazy and it’s usually absolutely fine with dev tools)… instead of throw new Error("a message")
, the engine itself errors-out and doesn’t even show that actual message.
I think this is because it assumes it is an Error
object, when it may not be. A check for that, and handling of any thrown value would just make it more rock-solid when it comes to showing users their errors.
…
On another related note, I saw this in the code:
// The following line is a hack to make it so "pause on caught errors" works for perchance errors in devtools.
// Click the function names in the "call stack" to go "back in time" and find more details about your error (ask for help on the forum if needed)
And I feel seen! 😜