Skip to main content

automd_rs/
error.rs

1//! Error types and Result alias.
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum Error {
7    #[error("Cargo.toml not found")]
8    CargoTomlNotFound,
9
10    #[error("IO error: {0}")]
11    Io(#[from] std::io::Error),
12
13    #[error("Parse Cargo.toml: {0}")]
14    CargoParse(String),
15
16    #[error("Invalid repository URL: {0}")]
17    InvalidRepoUrl(String),
18
19    #[error("Block handler '{0}': {1}")]
20    BlockHandler(String, String),
21}
22
23pub type Result<T> = std::result::Result<T, Error>;