22 lines
565 B
Rust
22 lines
565 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum AppError {
|
|
#[error("Network error: {0}")]
|
|
Network(#[from] reqwest::Error),
|
|
#[error("IO error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
#[error("JSON error: {0}")]
|
|
Json(#[from] serde_json::Error),
|
|
#[error("Configuration error: {0}")]
|
|
Config(String),
|
|
#[error("Child process error: {0}")]
|
|
Child(String),
|
|
#[error("Protocol error: {0}")]
|
|
Protocol(String),
|
|
#[error("Access denied by server")]
|
|
AccessDenied,
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, AppError>;
|