From e47ab5280aa4ca76734c13593fb57afa0f179c00 Mon Sep 17 00:00:00 2001 From: Jonathan Behrens Date: Sat, 13 Jan 2024 13:46:32 -0500 Subject: [PATCH] Clearer error messages for limit errors (#2094) --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 07ee275f21..4aa453cb41 100644 --- a/src/error.rs +++ b/src/error.rs @@ -465,8 +465,8 @@ impl Error for DecodingError { impl fmt::Display for LimitError { fn fmt(&self, fmt: &mut fmt::Formatter) -> Result<(), fmt::Error> { match self.kind { - LimitErrorKind::InsufficientMemory => write!(fmt, "Insufficient memory"), - LimitErrorKind::DimensionError => write!(fmt, "Image is too large"), + LimitErrorKind::InsufficientMemory => write!(fmt, "Memory limit exceeded"), + LimitErrorKind::DimensionError => write!(fmt, "Image size exceeds limit"), LimitErrorKind::Unsupported { .. } => { write!(fmt, "The following strict limits are specified but not supported by the opertation: ")?; Ok(())