diff --git a/src/error.rs b/src/error.rs index 4fa8bd61..f517d2d2 100644 --- a/src/error.rs +++ b/src/error.rs @@ -20,7 +20,7 @@ pub enum Error { FromHttpResponse(FromHttpResponseError), } -impl Display for Error { +impl Display for Error { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { Self::AuthenticationRequired => { @@ -29,9 +29,7 @@ impl Display for Error { Self::IntoHttp(err) => write!(f, "HTTP request construction failed: {}", err), Self::Url(UrlError(err)) => write!(f, "Invalid URL: {}", err), Self::Response(ResponseError(err)) => write!(f, "Couldn't obtain a response: {}", err), - // FIXME: ruma-client-api's Error type currently doesn't implement - // `Display`, update this when it does. - Self::FromHttpResponse(_) => write!(f, "HTTP response conversion failed"), + Self::FromHttpResponse(err) => write!(f, "HTTP response conversion failed: {}", err), } } } @@ -62,7 +60,7 @@ impl From> for Error { } } -impl std::error::Error for Error {} +impl std::error::Error for Error {} #[derive(Debug)] pub struct UrlError(http::uri::InvalidUri);