pub enum DataError {
Database(DbErr),
Sqlx(Error),
Pagination(PaginationError),
}Expand description
The error returned by the high-level data layer.
One database-error variant preserves the upstream SeaORM error (SeaORM’s
DbErr is already contextual — it distinguishes connection, query, record
not found, and constraint failures). A separate variant preserves raw
SQLx errors for the escape-hatch path. Pagination validation failures are
a distinct typed enum so they never collide with a database failure.
Variants§
Database(DbErr)
A SeaORM query, mutation, or transaction returned a database error.
Sqlx(Error)
A raw SQLx operation (the escape hatch) returned a database error.
Pagination(PaginationError)
A pagination argument was invalid (zero is not a valid page or per-page size).
Implementations§
Trait Implementations§
Source§impl Error for DataError
impl Error for DataError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<PaginationError> for DataError
impl From<PaginationError> for DataError
Source§fn from(value: PaginationError) -> Self
fn from(value: PaginationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for DataError
impl !UnwindSafe for DataError
impl Freeze for DataError
impl Send for DataError
impl Sync for DataError
impl Unpin for DataError
impl UnsafeUnpin for DataError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more