pub enum MessengerError {
InvalidId {
kind: &'static str,
value: String,
reason: String,
},
WireDecode(Error),
Http {
status: u16,
errcode: String,
error: String,
},
Crypto(String),
Store(StoreError),
FlushPending,
EditNotOwned {
event_id: EventId,
},
IntentRefused(String),
}Expand description
Every error this crate’s public API can return. Sans-I/O by construction (see the crate doc): this type never itself performs I/O — it only describes a failure the caller (a shell, or another module in this crate) already observed.
Variants§
InvalidId
One of the identifier newtypes in crate::ids rejected a value.
Fields
WireDecode(Error)
A wire payload (an HTTP response body, a /sync response, …) was
not valid JSON, or did not match the shape this crate expected of
it.
Http
An HTTP response came back with an error status and a Matrix-shaped
{"errcode": ..., "error": ...} body (client-server API’s own
standard error response shape).
Fields
Crypto(String)
A cryptographic operation (Olm/Megolm/SAS via mail4agent_vodozemac,
or the local record seal) failed. Wrapped as a plain message rather
than the concrete upstream error type: this crate’s own public API
must not leak mail4agent_vodozemac’s error enum shape as part of
its own contract.
Store(StoreError)
A crate::store::CryptoStore/crate::store::StateStore
operation failed.
FlushPending
Raised when a caller (crate::outgoing_queue/a later sync_engine
piece) attempts to release an outgoing request while
crate::persist::FlushEpoch::is_released reports it is not yet
safe to do so — a state mutation the request depends on is not yet
durably flushed and acknowledged. See the persist module doc for
the exact per-request ordering guarantee this enforces.
EditNotOwned
crate::MessengerCommand::SendMessage named an edit_of target
this account did not itself send (or that this core has never seen
at all) — rejected outright by crate::MessengerCore::dispatch
rather than silently sent as a replacement every other member’s own
m.replace aggregation would ignore anyway
(crate::room::relations’s own module doc: “must come from the
original sender”).
IntentRefused(String)
A crate::MessengerCommand the core refused to apply. The message
names the command and the reason (an unknown room, a sealed event, …).
Trait Implementations§
Source§impl Debug for MessengerError
impl Debug for MessengerError
Source§impl Display for MessengerError
impl Display for MessengerError
Source§impl Error for MessengerError
impl Error for MessengerError
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()
Source§impl From<CanonicalJsonError> for MessengerError
impl From<CanonicalJsonError> for MessengerError
Source§fn from(err: CanonicalJsonError) -> Self
fn from(err: CanonicalJsonError) -> Self
crate::canonical_json is its own small, dependency-light module
(it only needs mail4agent_vodozemac’s signature types, not this crate’s
error type) – this conversion is what lets crypto::account and
later pieces use ? against it without that module needing to know
about MessengerError itself.