use std::error::Error;
use std::fmt;
pub struct QuantrError {
pub(crate) message: String,
}
impl fmt::Display for QuantrError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "\x1b[91m[Quantr Error] {}\x1b[0m ", self.message)
}
}
impl fmt::Debug for QuantrError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&self, f)
}
}
impl Error for QuantrError {}
pub struct QuantrErrorConst {
pub(crate) message: &'static str,
}
impl fmt::Display for QuantrErrorConst {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "\x1b[91m[Quantr Error] {}\x1b[0m ", self.message)
}
}
impl fmt::Debug for QuantrErrorConst {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&self, f)
}
}
impl Error for QuantrErrorConst {}