devbrain 0.1.0

Local-first CLI to capture, search, and recall developer workflow (commands, errors, and fixes)
use std::fmt;

#[derive(Debug)]
pub enum DevbrainError {
    IoError(String),
    ParseError(String),
    InvalidEntryType(String),
    Other(String),
}

impl fmt::Display for DevbrainError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            DevbrainError::IoError(msg) => write!(f, "IO error: {}", msg),
            DevbrainError::ParseError(msg) => write!(f, "Parse error: {}", msg),
            DevbrainError::InvalidEntryType(msg) => write!(f, "Invalid entry type: {}", msg),
            DevbrainError::Other(msg) => write!(f, "Error: {}", msg),
        }
    }
}