use serde::Serialize; #[derive(Debug)] pub enum ApiErrorType { DbError, NotFoundError, } impl Default for ApiErrorType { fn default() -> ApiErrorType { ApiErrorType::NotFoundError } } #[derive(Debug, Default)] pub struct ApiError { pub message: Option, pub cause: Option, pub error_type: ApiErrorType, }