Fix test
This commit is contained in:
committed by
Martin Algesten
parent
18a9b08973
commit
be6be7e600
@@ -254,7 +254,10 @@ fn io_error() {
|
|||||||
let mut err = Error::new(ErrorKind::Io, Some("oops".to_string())).src(ioe);
|
let mut err = Error::new(ErrorKind::Io, Some("oops".to_string())).src(ioe);
|
||||||
|
|
||||||
err = err.url("http://example.com/".parse().unwrap());
|
err = err.url("http://example.com/".parse().unwrap());
|
||||||
assert_eq!(err.to_string(), "http://example.com/: Io: oops: too slow");
|
assert_eq!(
|
||||||
|
err.to_string(),
|
||||||
|
"http://example.com/: Network Error: oops: too slow"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ impl Request {
|
|||||||
unit::connect(unit, true, 0, reader, false).map_err(|e| e.url(url.clone()))?;
|
unit::connect(unit, true, 0, reader, false).map_err(|e| e.url(url.clone()))?;
|
||||||
|
|
||||||
if response.error() && self.error_on_non_2xx {
|
if response.error() && self.error_on_non_2xx {
|
||||||
Err(ErrorKind::HTTP.new().url(url.clone()).response(response))
|
Err(Error::Status(response.status(), response))
|
||||||
} else {
|
} else {
|
||||||
Ok(response)
|
Ok(response)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user