diff options
author | Cyborus <cyborus@cyborus.xyz> | 2023-11-19 19:09:32 +0100 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2023-11-19 19:09:32 +0100 |
commit | 6728bc0b11fa4b1ffd1758ba71ac516ce58da249 (patch) | |
tree | f277185691a2b4d9f9de3a020aeefdd3c3af166b /src | |
parent | Merge pull request 'fix `Issue` `pull_request` field' (#11) from fix-issue-pr... (diff) | |
download | forgejo-api-6728bc0b11fa4b1ffd1758ba71ac516ce58da249.tar.xz forgejo-api-6728bc0b11fa4b1ffd1758ba71ac516ce58da249.zip |
add source reqwest error to `ForgejoError::BadStructure`
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) } |