Currently all errors coming from the depths of rest-client are rescued and translated to IOError. I suggest to change it:
It's a bad practice to rescue Exception. If you want to rescue all exceptions, rescue StandardError. Here's why.
As in the scenario described in #15, an error may occasionally happen somewhere deep in rest-client, that has nothing to do with network communication, but results solely from gems incompatibility or other client-side software misfortune. It is really misleading to mask such errors as IOError.
I believe the right thing to do is to only handle exceptions raised by rest-client (which fortunately have a common ancestor RestClient::Exception). rest-client already does an awesome job handling various exceptions from the layers below and translating them to instances of it's own exception types, so you can be assured that exceptions of other types aren't "mere IO errors" and signal deeper problems.
Currently all errors coming from the depths of rest-client are rescued and translated to
IOError
. I suggest to change it:Exception
. If you want to rescue all exceptions, rescueStandardError
. Here's why.IOError
.I believe the right thing to do is to only handle exceptions raised by rest-client (which fortunately have a common ancestor
RestClient::Exception
). rest-client already does an awesome job handling various exceptions from the layers below and translating them to instances of it's own exception types, so you can be assured that exceptions of other types aren't "mere IO errors" and signal deeper problems.