summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2023-11-19 19:09:32 +0100
committerCyborus <cyborus@cyborus.xyz>2023-11-19 19:09:32 +0100
commit6728bc0b11fa4b1ffd1758ba71ac516ce58da249 (patch)
treef277185691a2b4d9f9de3a020aeefdd3c3af166b /src
parentMerge pull request 'fix `Issue` `pull_request` field' (#11) from fix-issue-pr... (diff)
downloadforgejo-api-6728bc0b11fa4b1ffd1758ba71ac516ce58da249.tar.xz
forgejo-api-6728bc0b11fa4b1ffd1758ba71ac516ce58da249.zip
add source reqwest error to `ForgejoError::BadStructure`
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
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<reqwest::Error> for ForgejoError {
fn from(e: reqwest::Error) -> Self {
if e.is_decode() {
- ForgejoError::BadStructure
+ ForgejoError::BadStructure(e)
} else {
ForgejoError::ReqwestError(e)
}