#[derive(Clone, Debug, PartialEq, Eq)]
pub enum JsonObjectError {
KeyIsEmpty,
KeyAlreadyExists,
ValueIsNull,
KeyOrValueIsNull,
PaseError,
}
impl std::fmt::Display for JsonObjectError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
JsonObjectError::KeyIsEmpty => write!(f, "Key is empty"),
JsonObjectError::KeyAlreadyExists => write!(f, "Key already exists"),
JsonObjectError::ValueIsNull => write!(f, "Value is null"),
JsonObjectError::KeyOrValueIsNull => write!(f, "Key or value is null"),
JsonObjectError::PaseError => write!(f, "Parse error"),
}
}
}
impl std::error::Error for JsonObjectError {}