Skip to content

Commit fd0ea23

Browse files
committed
improve error message when MAX_PENDING_MESSAGES is exceeded
see #441
1 parent 903126d commit fd0ea23

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/webserver/http.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ impl Write for ResponseWriter {
9393
fn flush(&mut self) -> std::io::Result<()> {
9494
self.response_bytes
9595
.try_send(Ok(mem::take(&mut self.buffer).into()))
96-
.map_err(|e| std::io::Error::new(std::io::ErrorKind::WouldBlock, e.to_string()))
96+
.map_err(|e|
97+
std::io::Error::new(
98+
std::io::ErrorKind::WouldBlock,
99+
format!("{e}: Database messages limit exceeded. The server cannot store more than {} pending messages in memory.", self.response_bytes.capacity())
100+
)
101+
)
97102
}
98103
}
99104

0 commit comments

Comments
 (0)