Skip to main content

camel_bean/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum BeanError {
5    #[error("Bean not found: {0}")]
6    NotFound(String),
7
8    #[error("Bean method not found: {0}")]
9    MethodNotFound(String),
10
11    #[error("Parameter binding failed: {0}")]
12    BindingFailed(String),
13
14    #[error("Handler execution failed: {0}")]
15    ExecutionFailed(String),
16}
17
18impl From<BeanError> for camel_api::CamelError {
19    fn from(err: BeanError) -> Self {
20        camel_api::CamelError::ProcessorError(err.to_string())
21    }
22}