pub enum SealedError {
Serialization(String),
Deserialization(String),
InvalidGroupId(String),
InvalidPublicKey(String),
FieldTooLarge(usize),
}Expand description
Errors raised by the envelope codec, address derivation and the canonical signing-payload construction.
Every variant’s Display string is byte-identical to the
offline_protocol_mls::MlsError variant it maps onto, because these types
moved out of that enum and their rendered text reaches logs, telemetry and
two test suites that assert on substrings of it.
§Why this enum is not #[non_exhaustive]
Its sibling MlsError is, and the difference is deliberate.
From<SealedError> for MlsError in the MLS crate must map every variant to
the one it replaced; #[non_exhaustive] would force that impl to carry a
wildcard arm, and a wildcard arm is exactly how a new variant added here
silently starts rendering as some other error’s text. Leaving the enum
exhaustive makes adding a variant a compile error in the MLS crate until
someone maps it, which is the point. Adding a variant is a breaking change
for external consumers, and the workspace already moves every crate’s
version together.
Variants§
Serialization(String)
Failed to serialize data.
Deserialization(String)
Failed to deserialize data.
InvalidGroupId(String)
Group id failed storage-key validation (empty, oversized, or containing path-traversal / storage-hostile characters).
InvalidPublicKey(String)
Invalid public key format.
FieldTooLarge(usize)
A field of a canonical signing payload does not fit its u32 length
prefix.
Carried as its own variant rather than folded into
SealedError::Serialization so that both callers keep the exact
message they raised before this construction moved here: the engine
renders it bare into Error::Other, and the MLS crate wraps it in
MlsError::Serialization, which prepends its own prefix.
Trait Implementations§
Source§impl Clone for SealedError
impl Clone for SealedError
Source§impl Debug for SealedError
impl Debug for SealedError
Source§impl Display for SealedError
impl Display for SealedError
impl Eq for SealedError
Source§impl Error for SealedError
impl Error for SealedError
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()