use thiserror::Error;
#[derive(Debug, Error)]
pub enum CamelError {
#[error("no component registered for scheme '{0}'")]
UnknownScheme(String),
#[error("no route registered with id '{0}'")]
UnknownRoute(String),
#[error("endpoint error: {0}")]
Endpoint(String),
#[error("processor error: {0}")]
Processor(String),
#[error("predicate evaluation failed: {0}")]
Predicate(String),
#[error("invalid uri '{uri}': {reason}")]
InvalidUri { uri: String, reason: String },
#[error("context is not running")]
NotRunning,
#[error("context already running")]
AlreadyRunning,
#[error("channel closed")]
ChannelClosed,
#[error("io error")]
Io(#[from] std::io::Error),
#[error("url parse error")]
Url(#[from] url::ParseError),
}
pub type Result<T> = std::result::Result<T, CamelError>;