tfcconnection/src/api/errors.rs
2024-07-01 15:59:44 -05:00

20 lines
359 B
Rust

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<String>,
pub cause: Option<String>,
pub error_type: ApiErrorType,
}