File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ impl HttpClient {
288
288
HttpMessageLength :: Empty => { Vec :: new ( ) } ,
289
289
HttpMessageLength :: ContentLength ( length) => {
290
290
if length == 0 || length > MAX_HTTP_MESSAGE_BODY_SIZE {
291
- return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: InvalidData , "out of range" ) )
291
+ return Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: InvalidData , format ! ( "invalid response length: {} bytes" , length ) ) ) ;
292
292
} else {
293
293
let mut content = vec ! [ 0 ; length] ;
294
294
#[ cfg( feature = "tokio" ) ]
@@ -727,7 +727,7 @@ pub(crate) mod client_tests {
727
727
match client. get :: < BinaryResponse > ( "/foo" , "foo.com" ) . await {
728
728
Err ( e) => {
729
729
assert_eq ! ( e. kind( ) , std:: io:: ErrorKind :: InvalidData ) ;
730
- assert_eq ! ( e. get_ref( ) . unwrap( ) . to_string( ) , "out of range " ) ;
730
+ assert_eq ! ( e. get_ref( ) . unwrap( ) . to_string( ) , "invalid response length: 8032001 bytes " ) ;
731
731
} ,
732
732
Ok ( _) => panic ! ( "Expected error" ) ,
733
733
}
You can’t perform that action at this time.
0 commit comments