use std::{
error::Error,
fmt::{
self,
Display,
Formatter,
},
};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BodyCaptureError {
InvalidTotalLength {
captured: usize,
total: usize,
},
}
impl Display for BodyCaptureError {
#[inline]
fn fmt(&self, formatter: &mut Formatter<'_>) -> fmt::Result {
match self {
Self::InvalidTotalLength { captured, total } => write!(
formatter,
"truncated body total length {total} must exceed {captured} captured bytes",
),
}
}
}
impl Error for BodyCaptureError {}