#[non_exhaustive]pub enum Error {
Invalid(Error),
NotLater {
what: &'static str,
key: String,
given: String,
latest: String,
},
NotFound {
what: &'static str,
key: String,
},
Mismatch {
what: &'static str,
expected: String,
found: String,
},
Conflict {
hash: String,
},
Database(DatabaseError),
PoolTimeout,
Migration(String),
Config(String),
}Expand description
What a Store method or a migration can fail with.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Invalid(Error)
The core rejected the input: not canonical, not a receipt, a receipt that does not
verify against the stored key document, not an instant or hash, a key document that
does not satisfy SPEC 9.2, … The core’s error carries its code
(Error::code), JSON path and detail.
NotLater
An append-only history refused a time that is not later than its latest entry:
put_version (what = "version", key = the cell id), bind_name ("name",
the function name) or put_namespace ("namespace", the host; equal is allowed
there).
Fields
NotFound
Something the write refers to is not in the store: the receipt of a version, the descriptor of a name binding.
Mismatch
The receipt named by put_version is for another cell, or has another tx.
Fields
Conflict
A receipt with this hash is stored with other bytes: the same payload with another
valid signature by the same key (the receipt hash does not cover sig; it covers
computed_by, so a rotated key gives another hash). Only a randomised signer makes
two valid signatures; RFC 8032 Ed25519 is deterministic. The stored receipt is kept.
Database(DatabaseError)
The database refused or failed: the server’s message and SQLSTATE (PostgreSQL) or SQLite’s message and result code, or the driver’s description of a failure that is not the database’s (no connection, a URL that does not parse, a TLS handshake refused, a certificate that did not verify).
PoolTimeout
No connection became free within the pool’s checkout timeout.
Migration(String)
A migration could not be applied or checked.
Config(String)
A connection option is unusable: a root certificate bundle
(PoolOptions::tls_root_certificates_pem)
with no certificate, or one that does not parse.
Implementations§
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)>
For Error::Database, the driver’s error (as in 0.1.0; the DatabaseError is
this error’s own text, so a chain of sources does not repeat it).
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()