File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,7 @@ impl HttpClient {
288288 HttpMessageLength :: Empty => { Vec :: new ( ) } ,
289289 HttpMessageLength :: ContentLength ( length) => {
290290 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 ) ) ) ;
292292 } else {
293293 let mut content = vec ! [ 0 ; length] ;
294294 #[ cfg( feature = "tokio" ) ]
@@ -727,7 +727,7 @@ pub(crate) mod client_tests {
727727 match client. get :: < BinaryResponse > ( "/foo" , "foo.com" ) . await {
728728 Err ( e) => {
729729 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 " ) ;
731731 } ,
732732 Ok ( _) => panic ! ( "Expected error" ) ,
733733 }
You can’t perform that action at this time.
0 commit comments