36 lines
672 B
Rust
36 lines
672 B
Rust
|
use std::io;
|
||
|
|
||
|
#[derive(Debug)]
|
||
|
pub struct Error {
|
||
|
msg: String,
|
||
|
}
|
||
|
|
||
|
impl From<ureq::Error> for Error {
|
||
|
fn from(value: ureq::Error) -> Self {
|
||
|
Self {
|
||
|
msg: value.to_string(),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
impl From<io::Error> for Error {
|
||
|
fn from(value: io::Error) -> Self {
|
||
|
Self {
|
||
|
msg: value.to_string(),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
impl From<serde_json::Error> for Error {
|
||
|
fn from(value: serde_json::Error) -> Self {
|
||
|
Self {
|
||
|
msg: value.to_string(),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
impl From<roxmltree::Error> for Error {
|
||
|
fn from(value: roxmltree::Error) -> Self {
|
||
|
Self {
|
||
|
msg: value.to_string(),
|
||
|
}
|
||
|
}
|
||
|
}
|