1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::prelude::TEvent;

#[derive(Debug, Clone)]
pub enum BaseError {
	NotFound,
	StopSentinel,
	TransactionError,
	StopSentinelWithEvent(std::sync::Arc<dyn TEvent>),
	DatabaseError(String),
	ServiceError,
}

pub trait ApplicationResponse: 'static + Send + Sync {}

pub trait ApplicationError: 'static + std::fmt::Debug + Send + Sync {}
impl ApplicationError for BaseError {}

impl From<BaseError> for Box<dyn ApplicationError> {
	fn from(value: BaseError) -> Self {
		Box::new(value)
	}
}

impl ApplicationResponse for () {}

impl ApplicationError for () {}