Skip to content

Instantly share code, notes, and snippets.

@dmichael
Created June 11, 2009 15:09
Show Gist options
  • Select an option

  • Save dmichael/127963 to your computer and use it in GitHub Desktop.

Select an option

Save dmichael/127963 to your computer and use it in GitHub Desktop.
begin
response = RestClient.get("http://cupcakestastegood.com")
# Net::HTTP connection error
rescue Errno::ECONNREFUSED => error
p "This error has no response body: #{e}"
# RestClient exceptions
rescue RestClient::Exception => error_response
p "This error is actually a response body"
p "... we should now check for the status"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment