diff --git a/actix-http/src/body/utils.rs b/actix-http/src/body/utils.rs index 7af5a50ad..d1449179f 100644 --- a/actix-http/src/body/utils.rs +++ b/actix-http/src/body/utils.rs @@ -3,6 +3,7 @@ use std::task::Poll; use actix_rt::pin; use actix_utils::future::poll_fn; use bytes::{Bytes, BytesMut}; +use derive_more::{Display, Error}; use futures_core::ready; use super::{BodySize, MessageBody}; @@ -36,7 +37,8 @@ pub async fn to_bytes(body: B) -> Result { } /// Error type returned from [`to_bytes_limited`] when body produced exceeds limit. -#[derive(Debug)] +#[derive(Debug, Display, Error)] +#[display(fmt = "limit exceeded while collecting body bytes")] #[non_exhaustive] pub struct BodyLimitExceeded;