diff --git a/Cargo.toml b/Cargo.toml index cba97538..5455ad79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -152,6 +152,7 @@ tikv-jemallocator = { version = "0.6", features = [ ], optional = true } sd-notify = { version = "0.4", optional = true } +# Used for inspecting request errors http-body-util = "0.1.3" # Used for matrix spec type definitions and helpers diff --git a/src/api/ruma_wrapper/axum.rs b/src/api/ruma_wrapper/axum.rs index 73a75b3d..2eb2c7f8 100644 --- a/src/api/ruma_wrapper/axum.rs +++ b/src/api/ruma_wrapper/axum.rs @@ -1,4 +1,5 @@ use std::{collections::BTreeMap, iter::FromIterator, str}; +use std::error::Error as _; use axum::{ body::Body, @@ -60,9 +61,9 @@ where ) .await .map_err(|err| { - if std::error::Error::source(&err) + if err.source() .as_ref() - .and_then(|err| std::error::Error::source(err)) + .and_then(|err| err.source()) .is_some_and(|err| err.is::()) { Error::BadRequest(ErrorKind::TooLarge, "Reached maximum request size")