24 lines
581 B
Rust
24 lines
581 B
Rust
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()),
|
|
}
|
|
}
|
|
}
|