These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:03 pm Advanced search

Improvements for onerror line 0 and line 1 errors

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

Improvements for onerror line 0 and line 1 errors

Postby JAB Creations » Wed Jan 25, 2012 12:30 am

Saw this...
http://html5.org/tools/web-apps-tracker ... 13&to=6914

...and came to this...
http://www.w3.org/TR/html5/webappapis.h ... ipt-errors

I log JavaScript errors to a database and look over them. Unfortunately about half are useless line 0 or line 1 errors with no realistic way to determine how the error was triggered and thus making the error report useless.

Secondly it would be exceptionally useful if the onerror event emulated PHP's error handling. A function name and perhaps a back-tracking ability (what called what, did function a1 call b2 and b2 spawned the error? etc).

Having these two issues covered by the spec would greatly improve error handling.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: Improvements for onerror line 0 and line 1 errors

Postby zcorpan » Fri Feb 03, 2012 8:35 am

Browsers could include the stack trace in the message argument. Is that good enough?
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: Improvements for onerror line 0 and line 1 errors

Postby JAB Creations » Fri Feb 03, 2012 11:34 am

Had to look up stack trace but was what I thought it would be; that would include the list of say functions in a separate object/array from from the say again function name where the error occurred?
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: Improvements for onerror line 0 and line 1 errors

Postby zcorpan » Fri Feb 03, 2012 11:53 am

Yep. My thinking was that the whole trace could be dumped in the message (as plain text).
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Re: Improvements for onerror line 0 and line 1 errors

Postby JAB Creations » Tue Feb 07, 2012 2:15 am

Cool. What about JavaScript errors spawned from browser plugins/extensions/etc? I think a lot of the JavaScript errors in my site's log seem to be spawned from those.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA

Re: Improvements for onerror line 0 and line 1 errors

Postby JamesMGreene » Tue May 08, 2012 8:26 pm

I feel that @zcorpan's proposal may be a sufficient workaround but it's not a valid solution. Here is my counter-proposal: https://gist.github.com/3ded0f6e7f0a658b9394
JamesMGreene
<h6>
 
Posts: 3
Joined: Tue May 08, 2012 8:20 pm

Re: Improvements for onerror line 0 and line 1 errors

Postby arabella » Sat Mar 14, 2015 9:43 am

Yeah, I guess the spec could be a bit clearer about the canvas element. Could you file a spec bug, please? :)



emma
arabella
<h6>
 
Posts: 1
Joined: Sat Mar 14, 2015 9:36 am


Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest