The JS onerror event and the ECMA Standard

Michael Ratcliffe michael at
Mon Jan 5 04:42:53 PST 2009

I have a question about the Javascript onerror event ... I know it is not part of the
ECMA standard and that is my point.

I have a complex web app used by some large corporations. This web app is used to create
online tests for their customers (members of the public). There can be hundreds of
factors that can come together to create a JavaScript bug ... UA, popup blockers, path
taken, popup window or not, computers regional settings, browser settings etc., etc.

It is obviously not very professional for us to ask a corporation to have members of the
public install debugging tools to try and isolate a bug, but currently that is the
situation that a lot of us face. An increasing number of devs are turning to the method
of trapping the error and logging as much info as possible using AJAX.

Are there any plans to make onerror part of the ECMA standard and, if so, is it possible
for me to suggest adding an additional item that should be accessible from the onerror
handler? I would suggest that a fourth parameter be passed to the onerror handler, which
is the error object from the time the error is triggered. This would allow access to the
call stack from within the handler and would be an invaluable in uncovering complex bugs.

At the moment there is no possible way to do access the call stack or any other tracing
info in the event of an error ... almost every other modern language exposes this

More information about the Es-discuss mailing list