nrc-mls-storage 0.1.0

Storage abstraction for nostr-mls that wraps OpenMLS storage backends
Documentation
//! Error types for the messages module

use std::fmt;

/// Error types for the messages module
#[derive(Debug)]
pub enum MessageError {
    /// Invalid parameters
    InvalidParameters(String),
    /// Database error
    DatabaseError(String),
}

impl std::error::Error for MessageError {}

impl fmt::Display for MessageError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            Self::InvalidParameters(message) => write!(f, "Invalid parameters: {}", message),
            Self::DatabaseError(message) => write!(f, "Database error: {}", message),
        }
    }
}