#[non_exhaustive]pub enum Error {
Show 13 variants
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,
},
NamespaceSuspended {
host: String,
suspended_at: String,
},
NameTaken {
name: String,
bound_as: &'static str,
},
Database(DatabaseError),
PoolTimeout,
Migration(String),
Unsupported(String),
Timeout(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, or (since 0.4.1) the class or a method’s descriptor of a class 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.
NamespaceSuspended
A new write under a suspended namespace (domain validation): a receipt signed by the
host, a version of such a receipt, or a name under the host, while the host’s
namespace is suspended (Namespace::suspended_at).
Reads, and putting a receipt that is already stored, are not refused.
NameTaken
Class names and function names share one namespace of names, and name is currently
bound as the other kind: Store::bind_class of a name
whose latest binding is a function (or of a class’s method name whose latest binding is
a class), or Store::bind_name of a name whose latest
binding is a class. Nothing is bound. Since 0.4.1.
Fields
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.
Unsupported(String)
The call needs a capability this store does not have: the vector calls
(vector_find, put_embeddings) where Store::vector_available
is false (SQLite, or PostgreSQL without the vector extension). Since 0.5.0.
Timeout(String)
An operation waited past its time bound (decided 27 Nov, the second review): the barrier’s wait
for a version writer (PoolOptions::barrier_timeout, or the SQLite options’ barrier timeout), or a
read under its statement timeout (slice_member_hashes_within). The text names the operation. The
http layer answers 503. Since 0.6.5.
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()