Revert deletions of client_error and friends.
This commit is contained in:
committed by
Martin Algesten
parent
64ebd47979
commit
18a9b08973
@@ -121,8 +121,8 @@ impl Request {
|
||||
let response =
|
||||
unit::connect(unit, true, 0, reader, false).map_err(|e| e.url(url.clone()))?;
|
||||
|
||||
if self.error_on_non_2xx && response.status() >= 400 {
|
||||
Err(Error::Status(response.status(), response))
|
||||
if response.error() && self.error_on_non_2xx {
|
||||
Err(ErrorKind::HTTP.new().url(url.clone()).response(response))
|
||||
} else {
|
||||
Ok(response)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user