use core::fmt::Display;

use alloc::string::String;

use crate::Value;

#[derive(Debug)]
pub struct Error {
    pub message: String,
    pub exception: Value,
}

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>;
