bovineaux
2007-Mar-06 05:44 UTC
Don''t muffle my errors - Responders.dispatch and try/catch
Firebug and Microsoft Script Editor are wonderful things for debugging
errors, but only if the error reaches them to begin with.
In this project I''m working on - my first use of prototype - I was
getting an error from some fairly complex, post-ajax-response DOM
manipulation, which was quite hard to track down using alerts and
console.debugs in an onException responder.
I tried a fairly simple throw of my own ...
Ajax.Responders.register( { onException: function (request, err)
{ throw err; } } );
... but that didn''t work because in prototype.js:784 (1.5.0) it mutes
every callback error thrown with a ...
try {
responder[callback].apply(...);
} catch (e) {}
Simply commenting out that try statement does the trick. Firebug and
MSE now receive the errors I''m throwing from my onException responder
and, even better, if I remove the responder the errors go back to
being muted because it''s already part of an earlier catch...
I''m just
choosing to throw the full error in my responder.
So - is there something I''m missing here? That try / catch just seemed
superfluous to me.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---