eXeed / blackbirdjs

Automatically exported from code.google.com/p/blackbirdjs
0 stars 0 forks source link

Request: Extend functionality with exception handling #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
One major problem in developing in JavaScript is the exception handling. In
JavaScript you can use window.onerror to get a message when an error
occured (besides the try-catch thing).

So, I think t would be nice to include exception handling inside this
software. One thing the software can do is to get a trace from the
exception for each browser and to give a possibility to inform the
programmer via AJAX or script tag about an exception which has occured (for
example with the whole log output). 

Original issue reported on code.google.com by joern.h...@gmail.com on 10 Oct 2008 at 5:01

GoogleCodeExporter commented 9 years ago
I agree on the premise -- it's undesirable to log an exception inside the 
logger,
just as it is to debug a debugger. One point to make is that if Blackbird owns 
and
suppresses the window.onerror, it would be impossible for any other library 
(such as
DamnIT [site: http://damnit.jupiterit.com/] -- designed for the sole purpose of
sending an xhr to the owner of the site) to function.

-gc

Original comment by GeorgeC...@gmail.com on 18 Oct 2008 at 7:39

GoogleCodeExporter commented 9 years ago
@GeorgeCalm

> it would be impossible for any other library (such as
> DamnIT [site: http://damnit.jupiterit.com/] -- designed
> for the sole purpose of sending an xhr to the owner of
> the site) to function.

How about wrapping window.onerror much like the functions that wrap 
window.onload?  Here is a perfect 
example of what I mean:
http://simonwillison.net/2004/May/26/addLoadEvent/

Original comment by joepec...@gmail.com on 1 Nov 2008 at 1:45

GoogleCodeExporter commented 9 years ago
Good point, Joe. Wrapping the window.onerror does allow multiple libraries to 
catch
the error. It would affect the entire page, not just blackbird, and would 
prevent any
code running after the error is caught in window.onerror to execute. Why not go 
with
try/catch? 

Original comment by GeorgeC...@gmail.com on 1 Nov 2008 at 7:49