2022-06-02 16:47:12 +05:30
|
|
|
use std::fmt::{Display, Formatter};
|
|
|
|
|
|
|
|
/// Necessary because of this issue: https://github.com/actix/actix-web/issues/1711
|
|
|
|
#[derive(Debug)]
|
2023-02-11 18:35:37 +05:30
|
|
|
pub struct Error(pub(crate) anyhow::Error);
|
2022-06-02 16:47:12 +05:30
|
|
|
|
|
|
|
impl Display for Error {
|
|
|
|
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
|
|
|
std::fmt::Display::fmt(&self.0, f)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> From<T> for Error
|
|
|
|
where
|
|
|
|
T: Into<anyhow::Error>,
|
|
|
|
{
|
|
|
|
fn from(t: T) -> Self {
|
|
|
|
Error(t.into())
|
|
|
|
}
|
|
|
|
}
|