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
TInternet should bubble up some exceptions #193
Comments
@dobbymoodge what about returning |
@joneslee85 That would be misleading - that response is sent by a server when it has accepted a connection, but the client has sent no request, or only a partial request, within some timeout threshold. The request may have failed because of a socket timeout. Unfortunately, older versions of rest-client bundle both cases under the same ruby-trello should raise appropriately distinct exceptions for each of the possible failure cases, where possible. I understand why |
@dobbymoodge 👍 would you be able to send us a PR? TIA |
I've got a working patch, just need to update the appropriate test(s)
|
jeremytregunna#193 This modifies the exception handling behavior in `TInternet` class method `try_execute`. `RestClient::Exceptions` which don't bear an HTTP response code (i.e. in the case of a connection timeout) will be raised instead of wrapped in a `Response` struct and returned.
jeremytregunna#193 This modifies the exception handling behavior in `TInternet` class method `try_execute`. `RestClient::Exceptions` which don't bear an HTTP response code (i.e. in the case of a connection timeout) will be raised instead of wrapped in a `Response` struct and returned.
https://github.com/jeremytregunna/ruby-trello/blob/master/lib/trello/net.rb#L22
If the request fails due to a timeout, the
RestClient::RequestTimeout
exception should be handled by the caller, right? Maybe this should only return aResponse
if!e.http_code.nil?
The text was updated successfully, but these errors were encountered: