iceshrimp-legacy/packages/backend/native-utils/src/model/error.rs
2023-06-02 23:48:24 -04:00

16 lines
489 B
Rust

use crate::impl_into_napi_error;
#[derive(thiserror::Error, Debug, PartialEq, Eq)]
pub enum Error {
#[error("Failed to parse string: {0}")]
ParseError(#[from] parse_display::ParseError),
#[error("Failed to get database connection: {0}")]
DbConnError(#[from] crate::database::error::Error),
#[error("Database operation error: {0}")]
DbOperationError(#[from] sea_orm::DbErr),
#[error("Requested entity not found")]
NotFound,
}
impl_into_napi_error!(Error);