[whatwg] window.onerror

Olav Junker Kjær olav at olav.dk
Sun Aug 29 15:51:54 PDT 2004


Jim Ley wrote:
> The next is to require ECMAScript Ed.3 (or potentially just the
> limited version for mobiles)  this will give everyone try/catch
> abilities so you won't need to worry about onerror, this I certainly
> think would be sensible.

The problem is if you want to have a global catch-all error handling, 
e.g. because you want to post an error report back to the server and 
show a custom error message for the user.

Since there is no "main" function in a webapp, you need a try-catch in 
every script block and event handler. This is not very clean. Also, 
errors may be generated from other sources than javascript, e.g. if a 
script or img does not load correctly. You can't handle that with 
try-catch.


Olav Junker Kjær



More information about the whatwg mailing list