W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2004

[whatwg] window.onerror

From: Olav Junker Kjr <olav@olav.dk>
Date: Mon, 30 Aug 2004 00:51:54 +0200
Message-ID: <41325E0A.4050401@olav.dk>
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
Received on Sunday, 29 August 2004 15:51:54 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:36 UTC