integrate-gitea (#2)
Reviewed-on: #2 Co-authored-by: Julien Fastré <julien.fastre@champs-libres.coop> Co-committed-by: Julien Fastré <julien.fastre@champs-libres.coop>
This commit was merged in pull request #2.
This commit is contained in:
@@ -1,4 +1,23 @@
|
||||
use reqwest::header::InvalidHeaderValue;
|
||||
use reqwest::Error;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct GeneralError {
|
||||
pub(crate) description: String,
|
||||
}
|
||||
|
||||
impl From<InvalidHeaderValue> for GeneralError {
|
||||
fn from(value: InvalidHeaderValue) -> Self {
|
||||
GeneralError {
|
||||
description: "Unable to convert the token into header value".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<reqwest::Error> for GeneralError {
|
||||
fn from(value: Error) -> Self {
|
||||
GeneralError {
|
||||
description: format!("Unable to perform a request: {}", value.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user