0a64db6925
Check go code / build-and-release (push) Successful in 1m9s
Reviewed-on: #5 Co-authored-by: Julien Fastré <julien.fastre@champs-libres.coop> Co-committed-by: Julien Fastré <julien.fastre@champs-libres.coop>
24 lines
574 B
Rust
24 lines
574 B
Rust
use reqwest::header::InvalidHeaderValue;
|
|
use reqwest::Error;
|
|
|
|
#[derive(Debug)]
|
|
pub struct GeneralError {
|
|
pub 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()),
|
|
}
|
|
}
|
|
}
|