microversus_codex 0.1.8

Types and definitions for interfacing with the microversus system
Documentation
use std::{error::Error, fmt};

#[derive(Debug, Default)]
pub enum MicroversusError {
    #[default]
    Unknown,
    Serde(serde_json::Error),
}

impl Error for MicroversusError {}

impl fmt::Display for MicroversusError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        match self {
            Self::Unknown => write!(f, "Unknown microversus error"),
            Self::Serde(err) => write!(f, "{:?}", err),
        }
    }
}

impl From<serde_json::Error> for MicroversusError {
    fn from(value: serde_json::Error) -> Self {
        MicroversusError::Serde(value)
    }
}