Skip to main content

nika_init/
error.rs

1//! Error types for nika-init crate.
2
3/// Errors from the init/course/showcase subsystem.
4#[derive(Debug, thiserror::Error)]
5pub enum NikaInitError {
6    /// I/O error during file operations (NIKA-093 equivalent)
7    #[error("NIKA-093: I/O error: {0}")]
8    IoError(#[from] std::io::Error),
9
10    /// Configuration error — TOML parse/serialize failures (NIKA-135 equivalent)
11    #[error("NIKA-135: Config error: {reason}")]
12    ConfigError { reason: String },
13
14    /// Validation error — e.g. "course already exists" (NIKA-004 equivalent)
15    #[error("NIKA-004: Validation error: {reason}")]
16    ValidationError { reason: String },
17}
18
19/// Convenience Result alias.
20pub type Result<T> = std::result::Result<T, NikaInitError>;