diff --git a/src/api/ruma_wrapper/axum.rs b/src/api/ruma_wrapper/axum.rs index f061856f..73a75b3d 100644 --- a/src/api/ruma_wrapper/axum.rs +++ b/src/api/ruma_wrapper/axum.rs @@ -60,7 +60,11 @@ where ) .await .map_err(|err| { - if std::error::Error::source(&err).as_ref().and_then(|err| std::error::Error::source(err)).is_some() { + if std::error::Error::source(&err) + .as_ref() + .and_then(|err| std::error::Error::source(err)) + .is_some_and(|err| err.is::()) + { Error::BadRequest(ErrorKind::TooLarge, "Reached maximum request size") } else { Error::BadRequest(ErrorKind::Unknown, "An unknown error has occurred")