use core::fmt::Display;
use alloc::string::String;
use crate::Value;
#[derive(Debug)]
pub struct Error {
pub(crate) message: String,
pub(crate) exception: Value,
}
impl Error {
pub fn message(&self) -> &str {
&self.message
}
pub fn exception(&self) -> Value {
self.exception
}
}
impl Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.message)
}
}
impl core::error::Error for Error {}
pub type Result<T> = core::result::Result<T, Error>;