ruva_core/
responses.rs

1use crate::prelude::TEvent;
2
3#[derive(Debug, Clone)]
4pub enum BaseError {
5	NotFound,
6	StopSentinel,
7	TransactionError,
8	StopSentinelWithEvent(std::sync::Arc<dyn TEvent>),
9	DatabaseError(String),
10	ServiceError,
11}
12
13pub trait ApplicationResponse: Send + Sync {}
14
15pub trait ApplicationError: 'static + std::fmt::Debug + Send + Sync {}
16impl ApplicationError for BaseError {}
17
18impl From<BaseError> for Box<dyn ApplicationError> {
19	fn from(value: BaseError) -> Self {
20		Box::new(value)
21	}
22}
23
24impl ApplicationResponse for () {}
25
26impl ApplicationError for () {}