Enum pocket_relay_database::DbErr
source · pub enum DbErr {
Show 16 variants
ConnectionAcquire,
TryIntoErr {
from: &'static str,
into: &'static str,
source: Box<dyn Error + Sync + Send + 'static, Global>,
},
Conn(RuntimeErr),
Exec(RuntimeErr),
Query(RuntimeErr),
ConvertFromU64(&'static str),
UnpackInsertId,
UpdateGetPrimaryKey,
RecordNotFound(String),
AttrNotSet(String),
Custom(String),
Type(String),
Json(String),
Migration(String),
RecordNotInserted,
RecordNotUpdated,
}
Expand description
An error from unsuccessful database operations
Variants§
ConnectionAcquire
This error can happen when the connection pool is fully-utilized
TryIntoErr
Fields
Runtime type conversion error
Conn(RuntimeErr)
There was a problem with the database connection
Exec(RuntimeErr)
An operation did not execute successfully
Query(RuntimeErr)
An error occurred while performing a query
ConvertFromU64(&'static str)
Type error: the specified type cannot be converted from u64. This is not a runtime error.
UnpackInsertId
After an insert statement it was impossible to retrieve the last_insert_id
UpdateGetPrimaryKey
When updating, a model should know its primary key to check if the record has been correctly updated, otherwise this error will occur
RecordNotFound(String)
The record was not found in the database
AttrNotSet(String)
Thrown by TryFrom<ActiveModel>
, which assumes all attributes are set/unchanged
Custom(String)
A custom error
Type(String)
Error occurred while parsing value as target type
Json(String)
Error occurred while parsing json value as target type
Migration(String)
A migration error
RecordNotInserted
None of the records are inserted, that probably means all of them conflict with existing records in the table
RecordNotUpdated
None of the records are updated, that means a WHERE condition has no matches. May be the table is empty or the record does not exist
Trait Implementations§
source§impl Error for DbErr
impl Error for DbErr
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl<E> From<DbErr> for TransactionError<E>where
E: Error,
impl<E> From<DbErr> for TransactionError<E>where E: Error,
source§fn from(e: DbErr) -> TransactionError<E>
fn from(e: DbErr) -> TransactionError<E>
source§impl From<DbErr> for TryGetError
impl From<DbErr> for TryGetError
source§fn from(e: DbErr) -> TryGetError
fn from(e: DbErr) -> TryGetError
source§impl From<TryGetError> for DbErr
impl From<TryGetError> for DbErr
source§fn from(e: TryGetError) -> DbErr
fn from(e: TryGetError) -> DbErr
source§impl PartialEq<DbErr> for DbErr
impl PartialEq<DbErr> for DbErr
impl Eq for DbErr
Auto Trait Implementations§
impl !RefUnwindSafe for DbErr
impl Send for DbErr
impl Sync for DbErr
impl Unpin for DbErr
impl !UnwindSafe for DbErr
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.