pub enum Error {
Show 19 variants
Database(Error),
UniqueViolation {
index: Option<String>,
},
ForeignKeyViolation {
constraint: Option<String>,
},
Deadlock,
LockWaitTimeout,
Read {
path: PathBuf,
source: Error,
},
DuplicateMigration {
name: String,
},
InvalidMigrationName {
name: String,
},
DuplicateTimestamp {
first: String,
second: String,
},
MigrationsLocked {
seconds: u64,
},
MigrationFailed {
name: String,
source: Error,
},
RollbackFailed {
name: String,
source: Error,
},
UnknownMigration {
name: String,
},
InvalidIdentifier(String),
UnsupportedDriver {
scheme: String,
},
Unsupported {
operation: &'static str,
driver: &'static str,
},
NotFillable {
table: &'static str,
column: String,
},
NotFound {
table: &'static str,
},
BlockingInRuntime,
}Expand description
Any error from Orbit. Driver errors that have a variant here are classified; the rest come
through unchanged as Database.
Variants§
Database(Error)
The database rejected a connection, a query, or a statement, and no other variant fits.
UniqueViolation
An insert or update broke a unique index or primary key. index is the index name when
the server reports it.
ForeignKeyViolation
A row refers to a missing parent, or a parent is still referenced. constraint is the
foreign key name when the server reports it.
Deadlock
The database rolled back the whole transaction to break a deadlock. Run it again.
LockWaitTimeout
A lock was not released in time. Only the statement failed; the transaction is still open.
Read
A file could not be read, such as a migration’s up.sql.
DuplicateMigration
Two migrations have the same name.
InvalidMigrationName
A migration name does not start with a 14-digit timestamp and an underscore.
DuplicateTimestamp
Two migrations share a timestamp, so their order is not defined.
MigrationsLocked
Another process is running migrations and did not finish within the lock timeout.
MigrationFailed
A migration’s up.sql failed. The run stopped there; earlier migrations stay applied.
RollbackFailed
A migration’s down.sql failed. The rollback stopped there.
UnknownMigration
A migration is recorded as applied, but this migrator has no folder for it, so it cannot
be rolled back. name is the version: the 14-digit timestamp prefix recorded in the table.
InvalidIdentifier(String)
A table or column name is empty or contains a quote character (a backtick or a double quote). The same rule applies to every database.
UnsupportedDriver
The URL’s scheme names a database whose Cargo feature is not enabled, or no database.
scheme is the part before the first :, never the password.
Unsupported
The database has no equivalent for this operation. operation names it and driver
names the database. See docs/laravel-differences.md for each case.
NotFillable
A column is not in the model’s FILLABLE list.
NotFound
A query that must find a row found none.
BlockingInRuntime
A blocking call ran on a thread that runs async code. Run it inside spawn_blocking.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Errorwhere
*const dyn Error + Sync + Send is !null: Freeze,
PhantomData<dyn Error + Sync + Send>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const dyn DatabaseError is !null: Freeze,
PhantomData<dyn DatabaseError>: Freeze,
*const () is !null: Freeze,
PhantomData<ErrorData<CustomOwner>>: Freeze,
*const MigrateError is !null: Freeze,
PhantomData<MigrateError>: Freeze,
&'static str: Freeze,
impl Move for Error
impl Send for Error
impl Sync for Errorwhere
BoxRaw<dyn Error + Sync + Send>: Sync,
RawVecInner: Sync,
BoxRaw<dyn DatabaseError>: Sync,
Repr: Sync,
BoxRaw<MigrateError>: Sync,
impl Unpin for Error
impl UnsafeUnpin for Errorwhere
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const dyn DatabaseError is !null: UnsafeUnpin,
PhantomData<dyn DatabaseError>: UnsafeUnpin,
*const () is !null: UnsafeUnpin,
PhantomData<ErrorData<CustomOwner>>: UnsafeUnpin,
*const MigrateError is !null: UnsafeUnpin,
PhantomData<MigrateError>: UnsafeUnpin,
&'static str: UnsafeUnpin,
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
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> ⓘ
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> ⓘ
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