Hi,

> when the function
> provided via onComplete is executed there will be no sub routines in
> the call stack

Right (well, not very many).  But if you look again a Glenn's
suggestion, he's saying that not having an onException handler in your
Ajax options is analogous to not having a try..catch block around you
code, so the exception would be raised to the browser.  He
demonstrated that much the same could be achieved by raising the
exceptions via a defer (setTimeout).  It doesn't provide nesting,
which I think is important, but it would make the exceptions not
silent in the absense of a handler, which was his goal.

I don't speak for the Core team, but I don't see it happening if none
of them have jumped into this thread so far.

FWIW,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jun 14, 12:41 am, rasmus <[email protected]> wrote:
> Any news on this? I myself was confused with the way Prototype seems
> to be swallowing exceptions without giving the developer a clue about
> it.
>
> As Glenn, I really feel that exceptions thrown from an ajax request
> should somehow be propagated upwards if no explicit onException
> (analogous to a catch in my mind) is provided.
>
> However, something tells me that the reason this is not done is due to
> the way ajax requests work. After an ajax request is sent, the js
> interpreter will reach the end of any global try block long before the
> ajax response returns. Hence, it does not make sense to propagate any
> exceptions upwards in the call stack as suggested; when the function
> provided via onComplete is executed there will be no sub routines in
> the call stack.
>
> Maybe this is the reason why no exceptions are thrown: you cannot
> possible wrap the onComplete function with a global try/catch block as
> it is called out of "normal" context.
>
> No matter what, I'd like to hear a clarification from someone who
> understands this better than I do :)
>
> On May 15, 10:06 pm, Glenn Maynard <[email protected]> wrote:
>
> > On Fri, May 15, 2009 at 4:47 AM, T.J. Crowder <[email protected]> 
> > wrote:
> > > I don't see any point in continuing this.  You feel quite strongly
> > > about this and I'm unlikely to change your mind.  I feel less strongly
> > > about it, but you're not likely to change my mind either -- not that
> > > it matters either way, as neither of us is a Core developer. :-)  I
> > > _do_ see your point about the absense of an onException handler being
> > > somewhat analagous to the absense of a catch block.
>
> > If you're not going to explain your opinion at all, then no, there's
> > no point in continuing this with you.  You havn't offered a single
> > reason for why the errors should not be raised if no exception
> > handlers are set.  Don't just assert your disagreement and then refuse
> > to explain it.
>
> > --
> > Glenn Maynard
>
>
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to