event_driven_core/
responses.rs

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