Skip to content

add new catch statement for ConnectTimeoutException #192

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

Closed
wants to merge 2 commits into from

Conversation

passos
Copy link

@passos passos commented Mar 21, 2013

Currently when ConnectTimeoutException happened, it will just throw it and caller can not get this from responseHandler.
I just added a new Catch statement to catch the ConnectTimeoutException so that the caller can get more specific error message.

@loopj
Copy link
Collaborator

loopj commented Mar 21, 2013

This will cause automatic retries to be skipped, I'm not sure we want to do this.
Any thoughts?

@passos
Copy link
Author

passos commented Mar 21, 2013

This ConnectTimeoutException is subclass of InterruptedIOException which is in exceptionBlacklist of RetryHandler. So retryRequest() will cancel retry for this exception currently. Which one do you prefer? To retry on this exception or return an error to caller?

@passos
Copy link
Author

passos commented Mar 22, 2013

btw, the SocketTimeoutException is similar with ConnectTimeoutException. It's also a subclass of InterruptedIOException. The retryRequest() catch SocketTimeoutException and return an error to caller so I think maybe you want to do the same for ConnectTimeoutException.

@smarek
Copy link
Member

smarek commented Oct 9, 2013

I see two issues with your merge request.
First, you're trying to catch error, which happens only if you use the library incorrectly by catching the issue afterwards. I'd rather see checking the url on set or before the request is created. Library shouldn't really automatically sanitise your generated URLs.
Second, you're fixing two different issues in your merge request, it's quite ambiguous.

I'll incorporate the ConnectTimeoutException myself.

@smarek smarek closed this in 8c06d35 Oct 9, 2013
@ghost ghost assigned smarek Oct 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants