//! Research subsystem error definitions.

use thiserror::Error;

#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ResearchError {
    #[error("research I/O failed: {0}")]
    Io(#[from] std::io::Error),
    #[error("research database failed: {0}")]
    Db(#[from] rusqlite::Error),
    #[error("research JSON failed: {0}")]
    Json(#[from] serde_json::Error),
    #[error("research HTTP failed: {0}")]
    Http(#[from] reqwest::Error),
    #[error("research task join failed: {0}")]
    Join(String),
    #[error("research workspace not found: {0}")]
    WorkspaceNotFound(String),
    #[error("research note not found: {0}")]
    NoteNotFound(String),
    #[error("research ghost note not found: {0}")]
    GhostNoteNotFound(String),
    #[error("research validation failed: {0}")]
    Validation(String),
}

pub type Result<T> = std::result::Result<T, ResearchError>;
