pub enum StoreError {
Sqlite(Error),
SchemaVersion {
found: i64,
expected: i64,
},
Reconstruct(String),
Focus(FocusError),
}Expand description
Errors the store can return. Typed (no unwrap/expect/panic!); wraps the
underlying SQLite error and the schema-stamp mismatch case.
Variants§
Sqlite(Error)
A rusqlite (SQLite) error — open, prepare, execute, or query failed.
SchemaVersion
The opened database carries a schema_version the running code does not know how
to read (a future migration step’s job; for now it is a fail-closed mismatch).
Reconstruct(String)
A persisted row could not be reconstructed into a FocusRecord on replay — a
malformed stored enum (an x_lane/x_token_type/x_access_path value with no
from_focus_str inverse), an unparseable timestamp, or an unparseable decimal
string. The store fails closed with this typed error rather than panicking or
silently substituting a default (which would corrupt the replayed ledger).
Focus(FocusError)
Building the FOCUS record from the reconstructed UnpricedUsage failed — the
underlying costroid_focus::FocusError (e.g. an out-of-range timestamp for the
FOCUS billing-period calculation), surfaced typed.
Trait Implementations§
Source§impl Debug for StoreError
impl Debug for StoreError
Source§impl Display for StoreError
impl Display for StoreError
Source§impl Error for StoreError
impl Error for StoreError
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()