1use thiserror::Error;
8
9#[derive(Debug, Error)]
10pub enum CamelError {
11 #[error("no component registered for scheme '{0}'")]
12 UnknownScheme(String),
13
14 #[error("no route registered with id '{0}'")]
15 UnknownRoute(String),
16
17 #[error("endpoint error: {0}")]
18 Endpoint(String),
19
20 #[error("processor error: {0}")]
21 Processor(String),
22
23 #[error("predicate evaluation failed: {0}")]
24 Predicate(String),
25
26 #[error("invalid uri '{uri}': {reason}")]
27 InvalidUri { uri: String, reason: String },
28
29 #[error("context is not running")]
30 NotRunning,
31
32 #[error("context already running")]
33 AlreadyRunning,
34
35 #[error("channel closed")]
36 ChannelClosed,
37
38 #[error("io error")]
39 Io(#[from] std::io::Error),
40
41 #[error("url parse error")]
42 Url(#[from] url::ParseError),
43}
44
45pub type Result<T> = std::result::Result<T, CamelError>;