1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Error-context helper for the session store's SQLite surface.
//!
//! The store and run ledger are dense with driver calls whose bare failures
//! (`no such table`, `database is locked`) say nothing about which operation
//! raised them. This trait attaches that operation context while funnelling
//! everything into [`TinyAgentsError::Storage`], so the crate keeps one error
//! type without every call site writing the same closure.
//!
//! It deliberately mirrors the shape of `anyhow::Context` — including the
//! `Option` impl for "row expected but absent" — because this module was
//! ported from a host that used `anyhow`, and matching the shape kept that
//! port mechanical and reviewable.
use Display;
use crate;
/// Attaches operation context to a fallible storage call, producing a
/// [`TinyAgentsError::Storage`].
pub
/// A `None` where a row was expected is a storage inconsistency, not a
/// user-facing absence — the callers using this read back a record they just
/// wrote, so `None` means the write silently failed.