On Monday 15 January 2007 13:49, Duncan Hill wrote:
On 15/01/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> If there is a single mistake on any of the lines in the onSuccess
> anonymous function, the JS appears to stop processing, and not a single
>
Well, a bit of digging later (darn searches for the wrong item, Venkman
debugger++), I've found that I can declare onException:
function(request,transport) and get access to transport.message for telling
me what went wrong. Hopefully exceptions won't be common in the code, but
I'll leave the handler in anyway, and make it do something nice.
I've found this to be problematic at times too - if you're chaining together
several functions in response to an async callback, then large portions of
your code will fall under the exception trap. Adding an onException handler
that simply re-throws the exception doesn't give you full access to the stack
trace. Usuallly, I just hack prototype.js and temporarily remove the
try/catch that invokes the onException callback (in 1.5.0_rc1, shipping with
the latest scriptaculous, it's around lines 750-790). Not very elegant, but
the debuggers like it. Make sure you only comment out the try and catch, not
all the stuff inbetween!!
HTH
Dave
--
----------------------
Author
Ajax in Action http://manning.com/crane
Ajax in Practice http://manning.com/crane2
Prototype & Scriptaculous Quickly http://manning.com/crane3
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---