Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveResource::Connection should rescue from Timeout::Error

#6

Net::HTTP can raise a Timeout::Error for both legitimate reasons (slow/unresponsive server) and the problems described in http://headius.blogspot.com/2008.... Right now, ARes emits this unhelpful exception+trace since there's no rescue block:

 execution expired
 /usr/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill'
 /usr/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill'
 /usr/lib/ruby/1.8/timeout.rb:56:in `timeout'
 /usr/lib/ruby/1.8/timeout.rb:76:in `timeout'
 /usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
 /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
 /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
 /usr/lib/ruby/1.8/net/http.rb:2017:in `read_status_line'
 /usr/lib/ruby/1.8/net/http.rb:2006:in `read_new'
 /usr/lib/ruby/1.8/net/http.rb:1047:in `request'
 /usr/lib/ruby/1.8/net/http.rb:1034:in `request'
 /usr/lib/ruby/1.8/net/http.rb:543:in `start'
 /usr/lib/ruby/1.8/net/http.rb:1032:in `request'
 /usr/lib/ruby/1.8/net/http.rb:769:in `get'
 [RAILS_ROOT]/vendor/rails/activeresource/lib/active_resource/connection.rb:110:in `send'
 [RAILS_ROOT]/vendor/rails/activeresource/lib/active_resource/connection.rb:110:in `request'

 ... SNIP

This patch rescues from Timeout::Error explicitly, introduces an ActiveResource::TimeoutError that is a child of ActiveResource::ConnectionError.

Reported by Cheah Chu Yeow · April 16th, 2008 @ 11:40 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Cheah Chu Yeow
    Cheah Chu Yeow
    • Title changed from [PATCH] ActiveResource::Connection should rescue from Timeout::Error to ActiveResource::Connection should rescue from Timeout::Error

    April 18th, 2008 @ 04:06 AM

  2. Michael Koziarski
    Michael Koziarski
    • State changed from new to resolved

    April 21st, 2008 @ 10:34 PM