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:
rescue HTTParty::Error => e
# handle e ...
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?
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.