Construct the response to listing the tree in gitea.
This commit is contained in:
25
src/gitea_client/error.rs
Normal file
25
src/gitea_client/error.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use std::error::Error;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) enum GiteaClientError {
|
||||
Static(#[allow(dead_code)] &'static str),
|
||||
String(#[allow(dead_code)] String),
|
||||
NoTotalCountHeaderInResponse,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for GiteaClientError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
GiteaClientError::Static(s) => write!(f, "GiteaClientError: {}", s),
|
||||
GiteaClientError::String(s) => write!(f, "GiteaClientError: {}", s),
|
||||
GiteaClientError::NoTotalCountHeaderInResponse => {
|
||||
write!(
|
||||
f,
|
||||
"GiteaClientError: No x-total-count header returned in gitea response.",
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for GiteaClientError {}
|
||||
Reference in New Issue
Block a user