Hello, I have to handle this exception: HTTP 502: Response body: Got EOF while waiting for outstanding responses (Koala::Facebook::APIError) and I have written this test: it "should handle Koala''s error" do get :test_action response.should redirect_to root_url flash[:alert].should == "HTTP 502: Response body: Got EOF while waiting for outstanding responses (Koala::Facebook::APIError)" end The file in which is used graph.batch is in lib folder and since I can''t use things like redirect_to or something else in these files I decided to handle this error writing rescue block in ApplicationController: rescue_from Koala::Facebook::APIError do |exception| redirect_to root_url, :alert => exception.message end But then I though that maybe I should handle 502 error and in that case I only have to write 502.html file in public folder. Right? Can someone help me with the right path to handle this error. Thanks in advance :) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/C4Vp2aLJSOYJ. For more options, visit https://groups.google.com/groups/opt_out.
On Wednesday, July 25, 2012 7:19:38 PM UTC+1, Tsvetelina Borisova wrote:> > The file in which is used graph.batch is in lib folder and since I can''t > use things like redirect_to or something else in these files I decided to > handle this error writing rescue block in ApplicationController: > > rescue_from Koala::Facebook::APIError do |exception| > redirect_to root_url, :alert => exception.message > end > > But then I though that maybe I should handle 502 error and in that case I > only have to write 502.html file in public folder. Right? > Can someone help me with the right path to handle this error. Thanks in > advance :) >It doesn''t look like there is a 502 error for you to handle directly - Koala has wrapped that up inside a Koala::Facebook::APIError. Rescuing at the controller with rescue_from sounds reasonable to me Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/AvQN1Q6qKRsJ. For more options, visit https://groups.google.com/groups/opt_out.