From 6728bc0b11fa4b1ffd1758ba71ac516ce58da249 Mon Sep 17 00:00:00 2001 From: Cyborus Date: Sun, 19 Nov 2023 13:09:32 -0500 Subject: add source reqwest error to `ForgejoError::BadStructure` --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 73e573f..0bef4c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ pub enum ForgejoError { #[error("API key should be ascii")] KeyNotAscii, #[error("the response from forgejo was not properly structured")] - BadStructure, + BadStructure(#[source] reqwest::Error), #[error("unexpected status code {} {}", .0.as_u16(), .0.canonical_reason().unwrap_or(""))] UnexpectedStatusCode(StatusCode), #[error("{} {}: {}", .0.as_u16(), .0.canonical_reason().unwrap_or(""), .1)] @@ -37,7 +37,7 @@ pub enum ForgejoError { impl From for ForgejoError { fn from(e: reqwest::Error) -> Self { if e.is_decode() { - ForgejoError::BadStructure + ForgejoError::BadStructure(e) } else { ForgejoError::ReqwestError(e) } -- cgit v1.2.3