20 lines
359 B
Rust
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,
|
|
}
|