I noticed that if I make an Ajax request with Prototype and the requested site isn''t running any more at the time of the request, I will receive the onComplete event, but not the onFailure (or onSuccess) event. Is this the expected outcome? Shouldn''t either onSuccess or onFailure be called no matter what? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
IMO, I would expect onFailure to be related to the HTTP errors 404,550, that Fails the HTTP request. onComplete would talk about the overall network connection which is closed after the timeout. Test for "not" onSuccess as error... Simon On 8/23/07, joshi <jshvrsn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I noticed that if I make an Ajax request with Prototype and the > requested site isn''t running any more at the time of the request, I > will receive the onComplete event, but not the onFailure (or > onSuccess) event. Is this the expected outcome? Shouldn''t either > onSuccess or onFailure be called no matter what? > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Okay, fair enough. But doesn''t it make the onSuccess and onFailure much less useful if there are "failure" modes that don''t trigger onFailure? Granted, if all you care about is the success mode, you''re okay. But if you need to also handle the "not success" mode, then you would always have to use the onComplete callback and check for success or failure manually. Is my thinking correct? Thanks for your help! P.S. How exactly do I test for "not" onSuccess? On Aug 23, 2:00 pm, Simon <simon....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> IMO, I would expect onFailure to be related to the HTTP errors > 404,550, that Fails the HTTP request. onComplete would talk about the > overall network connection which is closed after the timeout. > Test for "not" onSuccess as error... > > Simon > > On 8/23/07, joshi <jshv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I noticed that if I make an Ajax request with Prototype and the > > requested site isn''t running any more at the time of the request, I > > will receive the onComplete event, but not the onFailure (or > > onSuccess) event. Is this the expected outcome? Shouldn''t either > > onSuccess or onFailure be called no matter what?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
onFailure didn''t get triggered in a 404 response? Do you have example code of this occurring? On Aug 23, 3:34 pm, joshi <jshv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Okay, fair enough. But doesn''t it make the onSuccess and onFailure > much less useful if there are "failure" modes that don''t trigger > onFailure? Granted, if all you care about is the success mode, you''re > okay. But if you need to also handle the "not success" mode, then you > would always have to use the onComplete callback and check for success > or failure manually. Is my thinking correct? > > Thanks for your help! > > P.S. How exactly do I test for "not" onSuccess? > > On Aug 23, 2:00 pm, Simon <simon....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > IMO, I would expect onFailure to be related to the HTTP errors > > 404,550, that Fails the HTTP request. onComplete would talk about the > > overall network connection which is closed after the timeout. > > Test for "not" onSuccess as error... > > > Simon > > > On 8/23/07, joshi <jshv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I noticed that if I make an Ajax request with Prototype and the > > > requested site isn''t running any more at the time of the request, I > > > will receive the onComplete event, but not the onFailure (or > > > onSuccess) event. Is this the expected outcome? Shouldn''t either > > > onSuccess or onFailure be called no matter what?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It''s not actually a 404 response, it''s no response. To give a little context, here''s what I''m doing... I have an ''embedded'' system with a webserver running on it. We allow our users to upload an update file which reimages the unit and then reboots it. During the reimaging process I use AJAX to return update status to the user. When the unit is rebooting, I obviously don''t get a response from the webserver, but I want to keep polling it until it is back up and running. At that point, I tell the user that the unit is running again and they can log in. Also at that point I can stop polling the unit status. So what is happening, is that when the unit is not running, my AJAX poll fails, but it doesn''t fire my onFailure callback so I don''t get a chance to start another poll. On Aug 23, 3:21 pm, Matt Foster <mattfoste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> onFailure didn''t get triggered in a 404 response? Do you have example > code of this occurring? > > On Aug 23, 3:34 pm, joshi <jshv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Okay, fair enough. But doesn''t it make the onSuccess and onFailure > > much less useful if there are "failure" modes that don''t trigger > > onFailure? Granted, if all you care about is the success mode, you''re > > okay. But if you need to also handle the "not success" mode, then you > > would always have to use the onComplete callback and check for success > > or failure manually. Is my thinking correct? > > > Thanks for your help! > > > P.S. How exactly do I test for "not" onSuccess? > > > On Aug 23, 2:00 pm, Simon <simon....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > IMO, I would expect onFailure to be related to the HTTP errors > > > 404,550, that Fails the HTTP request. onComplete would talk about the > > > overall network connection which is closed after the timeout. > > > Test for "not" onSuccess as error... > > > > Simon > > > > On 8/23/07, joshi <jshv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I noticed that if I make an Ajax request with Prototype and the > > > > requested site isn''t running any more at the time of the request, I > > > > will receive the onComplete event, but not the onFailure (or > > > > onSuccess) event. Is this the expected outcome? Shouldn''t either > > > > onSuccess or onFailure be called no matter what?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---