On Mar 20, 2006, at 10:21 AM, Doug Crawford wrote:

>
> I have a top level exception handler that looks like:
> window.onerror = function(msg, file, line) {
>       var text = msg + "    " + file + "(" + line + ")";
>       alert(text);
> };
>
> When I throw an Error exception from a DOM signal handler that was
> attached using Mochikit.Signal.connect my top level exception handler
> never gets called.  There was a thread not to long ago discussing how
> Mochikit.Signal should deal with exceptions and it sounds it like now
> the code is just passing along the excpetion if only one handler  
> raised
> an exception.  I am using the latest version 639 which has this  
> change,
> but I still don't see why my top level exception handler is not  
> getting
> called.  Is there a better or more standard way to set up a top level
> exception handler?
>
> If I throw an excpetion in my signal handler using the following line,
> then my top level excpetion handler does get called.
> setTimeout(function () { throw exception; }, 0);
>
> Does this have somehting to do with the context in which the signal
> function is called?  Could this only be an issue for signals  
> associated
> with DOM events?

MochiKit.Signal uses addEventListener.  Errors that occur in  
listeners don't propagate to window.onerror.

You should be using FireBug instead: http://joehewitt.com/software/ 
firebug/

-bob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---

Reply via email to