-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
redirect and error reform #88
Conversation
- `Error` has been made an opaque struct. - `RedirectPolicy` now makes use of `RedirectAttempt` and `RedirectAction`.
The problem with hiding the underlying error behind With v0.5 I could have code that, say, retried the request on match send(url) {
Err(::reqwest::Error::Http(::reqwest::HyperError::Io(ref io_err))) => match io_err.kind() {
::std::io::ErrorKind::ConnectionAborted => /* retry */,
_ => /* abort */,
},
} but with v0.6 the result of Would it make sense to add |
I believe the if let Some(cause) = err.cause() {
match cause.downcast_ref::<hyper::Error>() {
Some(hyper::Error::Io(ref io)) => assert_eq!(io.kind(), ErrorKind::ConnectionAborted),
_ => ()
}
} The |
|
Oh what the... |
Ok, so there could be a few solutions to this:
|
I was bitten by this too in 0.6, as I have code that does retries on |
I'm still not certain what would be the best thing to expose. Tangentially, would there be benefit in reqwest retrying the requests itself, when the method is idempotent? |
Oh, looking at |
|
I just published v0.6.1 that adds |
Works like a charm. Thanks! |
This issue is related to seanmonstar#88 and would prevent issues like it when openssl 1.2 comes out. This commit adds support for building reqwest with rustls support, using the new feature flag `rustls`. This fixes seanmonstar#136.
Error
has been made an opaque struct.RedirectPolicy
now makes use ofRedirectAttempt
andRedirectAction
.