#[non_exhaustive]pub enum Error {
Net(Error),
Json(String),
MissingSnapshot,
Rolled,
TooLarge(usize),
DuplicateKey,
}Expand description
Errors produced while publishing or consuming JSON.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Net(Error)
An error from the underlying track.
Json(String)
A value failed to serialize, deserialize, or apply as a merge patch.
Stored as a string since serde_json::Error is not Clone.
MissingSnapshot
A merge patch arrived with no snapshot to apply it to.
Every group opens with a full snapshot, so this means frames reached
snapshot::Decoder out of order, or a group’s first frame was routed as a delta.
Rolled
A stream track carried a second group, which a lossless log cannot do.
A stream is a single group by construction: a publisher that cannot write a record ends the track rather than rolling. A second group therefore means the records that would have completed the first one are gone, so the read fails instead of presenting the remainder as a continuous log.
TooLarge(usize)
A decoded frame or reconstructed snapshot exceeded its configured byte budget.
DuplicateKey
A decoded frame repeated a key within one JSON object, which parsers resolve differently.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()