Created
June 11, 2009 15:09
-
-
Save dmichael/127963 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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