pub enum CoreError {
IdParse(String),
SchemaMismatch {
found: u16,
expected: u16,
},
JsonValidation(String),
Validation(String),
}Expand description
Errors raised by cortex-core parsing and validation.
Variants§
IdParse(String)
A string failed to parse as a prefix-ULID identifier.
Either the prefix did not match the expected variant (e.g. trc_…
passed where evt_… was required) or the ULID body was malformed.
SchemaMismatch
A persisted record was decoded with an unexpected schema_version.
Producers MUST refuse to operate on records whose schema is newer than
they understand; consumers MAY upcast older records via documented
migrations. See crate::SCHEMA_VERSION.
Fields
JsonValidation(String)
A JSON value failed structural validation (missing field, wrong type, constraint violation). The contained string is operator-facing detail.
Validation(String)
Generic value-shape validation failure (non-JSON contexts: invariants, pre-conditions on typed values).
Prefer CoreError::JsonValidation for failures that originated in a
JSON decode / schema check.
Trait Implementations§
Source§impl Error for CoreError
impl Error for CoreError
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()