OneLauncher-Cracked/packages/oneclient_db/src/error.rs
LynithDev 9ab0a0ecdd
Freya rewrite
This is v2 of OneClient. Removed all web-related stuff.

Co-Authored-By: Julian Chang <wyvest@polyfrost.org>
2026-07-05 16:37:05 -04:00

21 lines
433 B
Rust

use thiserror::Error;
#[derive(Debug, Error)]
pub enum DbError {
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Sqlx(#[from] sqlx::Error),
#[error(transparent)]
Migrate(#[from] sqlx::migrate::MigrateError),
#[error("record not found")]
NotFound,
#[error("invalid value for {field}: {value}")]
InvalidValue { field: String, value: String },
}
pub(crate) type DbResult<T> = Result<T, DbError>;