2024-10-24 22:32:42 +00:00
|
|
|
use reqwest::header::InvalidHeaderValue;
|
|
|
|
|
use reqwest::Error;
|
|
|
|
|
|
2024-03-15 23:10:21 +01:00
|
|
|
#[derive(Debug)]
|
2024-01-08 13:26:09 +01:00
|
|
|
pub struct GeneralError {
|
2025-11-12 19:10:41 +00:00
|
|
|
pub description: String,
|
2024-01-08 13:26:09 +01:00
|
|
|
}
|
2024-10-24 22:32:42 +00:00
|
|
|
|
|
|
|
|
impl From<InvalidHeaderValue> for GeneralError {
|
2025-10-24 23:24:47 +02:00
|
|
|
fn from(_value: InvalidHeaderValue) -> Self {
|
2024-10-24 22:32:42 +00:00
|
|
|
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()),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|