backie/src/blocking/error.rs
Ayrat Badykov 3e4bf7ddb7
chore(lint): fix clippy warnings (#109)
fix clippy warnings
2023-02-03 20:41:14 +02:00

32 lines
774 B
Rust

use crate::blocking::queue::QueueError;
use crate::FangError;
use diesel::r2d2::PoolError;
use diesel::result::Error as DieselError;
use std::io::Error as IoError;
impl From<IoError> for FangError {
fn from(error: IoError) -> Self {
let description = format!("{error:?}");
FangError { description }
}
}
impl From<QueueError> for FangError {
fn from(error: QueueError) -> Self {
let description = format!("{error:?}");
FangError { description }
}
}
impl From<DieselError> for FangError {
fn from(error: DieselError) -> Self {
Self::from(QueueError::DieselError(error))
}
}
impl From<PoolError> for FangError {
fn from(error: PoolError) -> Self {
Self::from(QueueError::PoolError(error))
}
}