canon_protocol/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum ProtocolError {
5    #[error("Invalid URI format: {0}")]
6    InvalidUri(String),
7
8    #[error("Invalid specification: {0}")]
9    InvalidSpecification(String),
10
11    #[error("Validation failed: {0}")]
12    ValidationError(String),
13
14    #[error("Parse error: {0}")]
15    ParseError(String),
16
17    #[error("IO error: {0}")]
18    Io(#[from] std::io::Error),
19
20    #[error("YAML error: {0}")]
21    Yaml(#[from] serde_yaml::Error),
22
23    #[error("JSON error: {0}")]
24    Json(#[from] serde_json::Error),
25}
26
27pub type ProtocolResult<T> = std::result::Result<T, ProtocolError>;