jerrett-simple-flickr 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/simple-flickr/client.rb +1 -1
- data/spec/client_spec.rb +1 -1
- metadata +1 -1
data/lib/simple-flickr/client.rb
CHANGED
@@ -80,7 +80,7 @@ module Flickr
|
|
80
80
|
|
81
81
|
begin
|
82
82
|
response = Hpricot.XML( open(url).read ).at('rsp')
|
83
|
-
rescue Timeout::Error, OpenURI::HTTPError, Errno::ECONNRESET, SocketError, Errno::ECONNREFUSED => e
|
83
|
+
rescue Errno::ETIMEDOUT, Timeout::Error, OpenURI::HTTPError, Errno::ECONNRESET, SocketError, Errno::ECONNREFUSED => e
|
84
84
|
raise RequestError.new(0, e)
|
85
85
|
end
|
86
86
|
raise RequestError.new(response.at('err')['code'], response.at('err')['msg']) unless response['stat'] == 'ok'
|
data/spec/client_spec.rb
CHANGED
@@ -15,7 +15,7 @@ describe Flickr::Client do
|
|
15
15
|
@flickr.request( 'favorites.getList', :user_id => '123456789N00', :per_page => 4 )
|
16
16
|
end
|
17
17
|
|
18
|
-
[Timeout::Error.new(nil), OpenURI::HTTPError.new(nil,nil), Errno::ECONNRESET, SocketError, Errno::ECONNREFUSED].each do |e|
|
18
|
+
[Errno::ETIMEDOUT,Timeout::Error.new(nil), OpenURI::HTTPError.new(nil,nil), Errno::ECONNRESET, SocketError, Errno::ECONNREFUSED].each do |e|
|
19
19
|
it "should raise an appropriate error if open-uri raises #{e}" do
|
20
20
|
@flickr.should_receive( :open ).and_raise( e )
|
21
21
|
proc { @flickr.request( 'test.echo' ) }.should raise_error( Flickr::RequestError )
|