pub enum SessionStoreError {
Unavailable,
DuplicateId,
}Expand description
Why a SessionStore operation could not be answered.
Not an Error for its own sake — it is one so a handler can ? it into the
same failure path as everything else the adapter refuses, and so
thiserror writes the text that reaches a log line.
§Why no id appears in either message
Because Display output here is very likely to end up in a log, and the
project does not log a full session id. Carrying the value inside the error
would make the leak one careless tracing::error!("{err}") away, and the
operator debugging a duplicate id wants to know that it happened far more
than they want to know which id it was — the source is the thing to inspect.
Variants§
A panic elsewhere unwound through the lock, so the map may be missing an insert it was midway through.
The store refuses rather than recovering, matching the idempotency store’s rule: answering from state this process cannot vouch for is how one request ends up served another request’s session.
DuplicateId
The injected IdSource returned an id that is already registered.
IdSource requires that an id is not reused while either session can
still appear in the event log, so this means the source has wrapped or
was seeded twice. Replacing the source is the fix; the store will not
overwrite, because doing so silently transfers an established session to
whoever asked next.
Trait Implementations§
Source§impl Clone for SessionStoreError
impl Clone for SessionStoreError
impl Copy for SessionStoreError
Source§impl Debug for SessionStoreError
impl Debug for SessionStoreError
Source§impl Display for SessionStoreError
impl Display for SessionStoreError
impl Eq for SessionStoreError
Source§impl Error for SessionStoreError
impl Error for SessionStoreError
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()