Make Error an enum again.
This commit is contained in:
committed by
Martin Algesten
parent
b20c4fc3be
commit
219185f73f
@@ -122,7 +122,7 @@ impl Request {
|
||||
unit::connect(unit, true, 0, reader, false).map_err(|e| e.url(url.clone()))?;
|
||||
|
||||
if self.error_on_non_2xx && response.status() >= 400 {
|
||||
Err(ErrorKind::HTTP.new().url(url.clone()).response(response))
|
||||
Err(Error::Status(response.status(), response))
|
||||
} else {
|
||||
Ok(response)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user