use std::fmt; pub struct ArchError(::err::Error); impl ArchError { pub fn with_msg>(s: S) -> Self { Self(::err::Error::with_msg(s)) } pub fn with_msg_no_trace>(s: S) -> Self { Self(::err::Error::with_msg_no_trace(s)) } pub fn msg(&self) -> &str { self.0.msg() } pub fn reason(&self) -> Option<::err::Reason> { self.0.reason() } pub fn public_msg(&self) -> Option<&Vec> { self.0.public_msg() } } impl fmt::Debug for ArchError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { self.0.fmt(fmt) } } impl fmt::Display for ArchError { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { fmt::Debug::fmt(self, fmt) } } impl std::error::Error for ArchError {} impl From<::err::Error> for ArchError { fn from(x: ::err::Error) -> Self { Self(x) } } impl From for ::err::Error { fn from(x: ArchError) -> Self { x.0 } } impl From for ArchError { fn from(k: std::string::FromUtf8Error) -> Self { Self::with_msg(k.to_string()) } } impl From for ArchError { fn from(k: std::io::Error) -> Self { Self::with_msg(k.to_string()) } } impl From> for ArchError { fn from(k: async_channel::SendError) -> Self { Self::with_msg(k.to_string()) } } impl From for ArchError { fn from(k: serde_json::Error) -> Self { Self::with_msg(k.to_string()) } }