30 lines
580 B
Rust
30 lines
580 B
Rust
//! Error types for the Cypraea shell.
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum CypraeaError {
|
|
#[error("I/O error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("Invalid JSON: {0}")]
|
|
Json(#[from] serde_json::Error),
|
|
|
|
#[error("Database error: {0}")]
|
|
Database(String),
|
|
|
|
#[error("Session error: {0}")]
|
|
Session(String),
|
|
|
|
#[error("Command error: {0}")]
|
|
Command(String),
|
|
|
|
#[error("Protocol error: {0}")]
|
|
Protocol(String),
|
|
|
|
#[error("{0}")]
|
|
Other(String),
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, CypraeaError>;
|