> Sure, after figuring out why exceptions are disappearing, and then > figuring out how to get around that all-encompassing exception block > surrounding the responder. It's a lot of digging to get reasonable > default behavior.
Or, you know, read the documentation. ;-) No, seriously, we'll have to agree to disagree on this. I'm just one counterpoint to your statement that "most people" would expect something else. I wouldn't. I expected, and quickly found when I started using Prototype's Ajax stuff, exactly what's there. I find the default behavior quite reasonable. -- T.J. :-) On May 14, 8:54 pm, Glenn Maynard <gl...@zewt.org> wrote: > On Thu, May 14, 2009 at 3:24 AM, T.J. Crowder <t...@crowdersoftware.com> > wrote: > > I don't think they would, but more to the point, "raised normally" > > *where*? In the normal case (asynchronous requests), the code that > > initiated the request has long since completed. So unless you mean > > raising exceptions to the browser (which doesn't seem like a good > > idea, and can result in your script being terminated completely), I > > don't see where it would get raised. And there's no standard for a > > global exception catcher, is there? Some browsers have them, I think, > > but I don't know of a standard for one. So even if Prototype raised > > the exception globally, how would you handle it? > > Errors in my code, when I havn't installed any error handler > explicitly, should be returned to the browser, to be displayed in the > usual error windows. If I want some other behavior, I'll install an > error handler (whether a try/catch block or, for Ajax.Request, an > onException handler). Discarding errors by default is very strange. > > The exception should minimally be re-thrown if no onException > handlers, local or global, exist. Attached patch (not heavily tested) > shows what I mean. > > > to be a fairly useful paradigm. (try = request, catch = onException, > > finally = onComplete) Maybe there could be an argument for > > Errors in onComplete are also sent to onException, so I think this > mapping is a little off. > > > If you want to semi-globally handle all exceptions in Ajax requests, > > as you show you can do it with a responder. If you want to semi- > > Sure, after figuring out why exceptions are disappearing, and then > figuring out how to get around that all-encompassing exception block > surrounding the responder. It's a lot of digging to get reasonable > default behavior. > > -- > Glenn Maynard > > prototype-1.5-ajax-rethrow.diff > < 1KViewDownload --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---