Skip to content

Commit

Permalink
show RequestTimeout in place of Timeout::Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wiggins committed Jun 21, 2008
1 parent c7b3130 commit 4f9d9a0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/request_errors.rb
Expand Up @@ -10,6 +10,9 @@ class Unauthorized < RuntimeError; end
# The server broke the connection prior to the request completing.
class ServerBrokeConnection < RuntimeError; end

# The server took too long to respond.
class RequestTimeout < RuntimeError; end

# The request failed, meaning the remote HTTP server returned a code other
# than success, unauthorized, or redirect.
#
Expand Down
2 changes: 2 additions & 0 deletions lib/rest_client.rb
Expand Up @@ -109,6 +109,8 @@ def transmit(uri, req, payload)
end
rescue EOFError
raise RestClient::ServerBrokeConnection
rescue Timeout::Error
raise RestClient::RequestTimeout
end

def setup_credentials(req)
Expand Down

0 comments on commit 4f9d9a0

Please sign in to comment.