File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -186,12 +186,9 @@ impl HttpChunkedTransferReaderState {
186
186
assert_eq ! ( self . parse_step, HttpChunkedTransferParseMode :: Chunk ) ;
187
187
188
188
if self . total_size >= self . max_size && self . chunk_size > 0 {
189
- return Err ( io:: Error :: new (
190
- io:: ErrorKind :: Other ,
191
- ChunkedError :: OverflowError (
192
- "HTTP body exceeds maximum expected length" . to_string ( ) ,
193
- ) ,
194
- ) ) ;
189
+ return Err ( io:: Error :: other ( ChunkedError :: OverflowError (
190
+ "HTTP body exceeds maximum expected length" . to_string ( ) ,
191
+ ) ) ) ;
195
192
}
196
193
197
194
let remaining = if self . chunk_size - self . chunk_read <= ( self . max_size - self . total_size ) {
Original file line number Diff line number Diff line change @@ -1979,18 +1979,14 @@ pub fn send_http_request(
1979
1979
let path = & request. preamble ( ) . path_and_query_str ;
1980
1980
let resp_status_code = response. preamble ( ) . status_code ;
1981
1981
let resp_body = response. body ( ) ;
1982
- return Err ( io:: Error :: new (
1983
- io:: ErrorKind :: Other ,
1982
+ return Err ( io:: Error :: other (
1984
1983
format ! (
1985
1984
"HTTP '{verb} {path}' did not succeed ({resp_status_code} != 200). Response body = {resp_body:?}"
1986
1985
) ,
1987
1986
) ) ;
1988
1987
}
1989
1988
_ => {
1990
- return Err ( io:: Error :: new (
1991
- io:: ErrorKind :: Other ,
1992
- "Did not receive an HTTP response" ,
1993
- ) ) ;
1989
+ return Err ( io:: Error :: other ( "Did not receive an HTTP response" ) ) ;
1994
1990
}
1995
1991
} ;
1996
1992
You can’t perform that action at this time.
0 commit comments