I am trying to catch failed Ajax requests, but I''m talking about requests that receive no response from the server (server is down), not responses that result in a 500. The latter can be handled with the onException or onFailure callback, but I am not able to handle the former. To reproduce/test: 1) Start your server 2) Create a page that does this: Ajax.PeriodicalUpdater(''foo'', ''/valid/url'', { onFailure: function(){alert(''failure'')}, onException: function(){alert(''exception'')}) 3) Bring the page up in your browser Initially, if the response is 200, you should see nothing. If you change the response to be a 404, you will see "failure". Change the response to be a 500, you will still see "failure". Bring the server down, you will not see anything, yet if you have Firebug running you will see that the requests resulted in errors (highlighted in red in Firebug). Two questions arise: 1) When does onException fire? 2) Is it possible to catch "server down" scenarios? Thanks guys. -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Justin Perkins wrote:> ... > 2) Is it possible to catch "server down" scenarios? > > Thanks guys. > > -justin >I''ve had to account for the server-down or lost-internet/vpn-connection scenarios and created this patch: http://dev.rubyonrails.org/ticket/10191 Per Tobie''s comments, a full patch is quite involved. However, I''ve been using the patch I posted in production since I posted it. It works on O9, FF2, IE6, S3 Win - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks a lot Ken, that''s exactly what I need to see. -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---