Files

23 lines
574 B
Rust
Raw Permalink Normal View History

2024-10-24 22:32:42 +00:00
use reqwest::header::InvalidHeaderValue;
use reqwest::Error;
#[derive(Debug)]
2024-01-08 13:26:09 +01:00
pub struct GeneralError {
pub description: String,
2024-01-08 13:26:09 +01:00
}
2024-10-24 22:32:42 +00:00
impl From<InvalidHeaderValue> for GeneralError {
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()),
}
}
}