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 Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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