16 lines
364 B
Rust
16 lines
364 B
Rust
pub type ServiceError = Box<dyn std::error::Error + Send + Sync>;
|
|
|
|
#[allow(dead_code)] // TODO: remove when used
|
|
pub trait IntoServiceError {
|
|
fn into_service_error(self) -> ServiceError;
|
|
}
|
|
|
|
impl<T> IntoServiceError for T
|
|
where
|
|
T: std::error::Error + Send + Sync + 'static,
|
|
{
|
|
fn into_service_error(self) -> ServiceError {
|
|
Box::new(self)
|
|
}
|
|
}
|