#[non_exhaustive]pub enum FlowError {
Io(Error),
Serde(Error),
CorruptLogLine(Box<LogCorruption>),
CapabilityError(String),
PreconditionFailed(Box<PreconditionFailure>),
TransactionIdPayloadMismatch {
transaction_id: String,
},
RevisionConflict {
expected: u64,
actual: u64,
},
BackupRejected(Box<BackupProblem>),
IncompatibleFormat(Box<FormatIncompatibility>),
}Expand description
Why an operation failed.
Branch on the variant, never on message text. The enum is #[non_exhaustive]: a later release
may add variants, so a match needs a catch-all arm. CapabilityError carries a human-readable
message, some of which begin with an upper-case code (INVALID_READ_SET:, EMPTY_PRECONDITION:);
those prefixes are not a supported way to tell failures apart and may change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
Serde(Error)
CorruptLogLine(Box<LogCorruption>)
CapabilityError(String)
PreconditionFailed(Box<PreconditionFailure>)
A transaction precondition did not hold. Nothing was written.
Separate from CapabilityError because a conflict is an expected
outcome of a race and a caller is meant to branch on it, while a
capability error is not.
TransactionIdPayloadMismatch
A transaction id was already committed with a different payload. Nothing was written, and the id still names the original transaction.
Returned when a payload hash is supplied for an id that was committed with another one, and also when an id that was committed without a hash is retried with one, since there is nothing recorded to verify against. Retrying with the same id cannot succeed: use a new id for a new transaction, or resend the original payload to confirm the original.
RevisionConflict
The transaction was based on a revision which is no longer current.
BackupRejected(Box<BackupProblem>)
A backup artifact was rejected. Nothing was restored.
IncompatibleFormat(Box<FormatIncompatibility>)
The durable database is in a format this build does not understand.
Returned by FeltDb::open before any record is interpreted, and
before anything is written. A database that returns this error is
untouched.
Trait Implementations§
Source§impl Error for FlowError
impl Error for FlowError
1.30.0 · 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()