Skip to content

Commit d3ad5ac

Browse files
committed
Improve error message for invalid response lengths.
1 parent 51d9ee3 commit d3ad5ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning-block-sync/src/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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: {}", length)));
292292
} else {
293293
let mut content = vec![0; length];
294294
#[cfg(feature = "tokio")]

0 commit comments

Comments
 (0)