-
Notifications
You must be signed in to change notification settings - Fork 966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception handling strategy when using httparty #209
Comments
👍 |
Yeah, that would be something nice to have! What's you opinion on this? Or maybe I should ask in which way do you handle errors? |
+1 |
bsingr
added a commit
to bsingr/httparty
that referenced
this issue
Nov 28, 2013
jnunemaker
pushed a commit
that referenced
this issue
Nov 30, 2013
Add HTTParty::Error base class. Refs #209.
Thanks for adding this in, very helpful. I just noticed this is still not part of a gem release yet. Will that happen soon? I'd prefer to bundle from a specific version rather than from the git repo if possible. |
+1 |
++ |
+1 |
This is not rescuing at all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey there!
I saw there are a few error classes defined in https://github.com/jnunemaker/httparty/blob/master/lib/httparty/exceptions.rb but there is no such thing as a global
HTTParty::Error
that allow a single rescue statement to catch up all possible errors when making requests with HTTParty. Instead I have to explicitely list all of the error classes defined by HTTParty.Also I saw that these error classes are only used for special cases that occur within the HTTParty codebase and not for wrapping exceptions that occur in underlying libraries such as Net:HTTP.
Is there any reason for that I didn't see or would you appreciate me implementing a global error class and wrapping up exceptions from underlying libraries?
To clarify, I'd like to be able to do sth. like:
Cheers
--dpree
The text was updated successfully, but these errors were encountered: