pub enum Error {
OldVersion(String),
SchemaMismatch {
actual: Option<Hash>,
expected: Option<Hash>,
},
SerdeFail(String),
BadHeader(String),
FailDecompress(String),
LengthTooLong {
max: usize,
actual: usize,
},
LengthTooShort {
step: &'static str,
actual: usize,
expected: usize,
},
BadSignature,
BadEncode(String),
FailValidate(String),
CryptoError(CryptoError),
ParseLimit(String),
}Expand description
A fog-pack error. Encompasses any issues that can happen during validation, encoding, or decoding.
Variants§
OldVersion(String)
Occurs when a subtype is using a version format that is no longer accepted. This is mainly for recognizing when the Cryptographic types and signatures use old, no longer accepted algorithms.
SchemaMismatch
Occurs when a schema doesn’t match the document’s schema, a Schema was used when one isn’t specified by the document, or a NoSchema was used when a document specified a schema.
Fields
SerdeFail(String)
Occurs when serde serialization or deserialization fails
BadHeader(String)
Occurs when the header (compression marker and optional schema) failed to parse correctly.
FailDecompress(String)
Occurs when zstd compression fails, possibly due to a dictionary not being present in a schema, a checksum failing, or any of the other zstd failure modes.
LengthTooLong
Document/Entry/Query was greater than maximum allowed size on decode
LengthTooShort
Document/Entry/Query ended too early.
Fields
BadSignature
Signature attached to end of Document/Entry/Query didn’t validate
BadEncode(String)
Basic fog-pack encoding failure
FailValidate(String)
Schema validation failure.
CryptoError(CryptoError)
Failure within the cryptographic submodule.
ParseLimit(String)
Schema or validation hit some parsing limit.
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
Source§impl Error for Error
impl Error for Error
Source§fn custom<T: Display>(msg: T) -> Self
fn custom<T: Display>(msg: T) -> Self
Source§fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_type(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a type different from what it was
expecting. Read moreSource§fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
fn invalid_value(unexp: Unexpected<'_>, exp: &dyn Expected) -> Self
Deserialize receives a value of the right type but that
is wrong for some other reason. Read moreSource§fn invalid_length(len: usize, exp: &dyn Expected) -> Self
fn invalid_length(len: usize, exp: &dyn Expected) -> Self
Source§fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self
Deserialize enum type received a variant with an
unrecognized name.Source§fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self
Deserialize struct type received a field with an
unrecognized name.Source§fn missing_field(field: &'static str) -> Self
fn missing_field(field: &'static str) -> Self
Deserialize struct type expected to receive a required
field with a particular name but that field was not present in the
input.Source§fn duplicate_field(field: &'static str) -> Self
fn duplicate_field(field: &'static str) -> Self
Deserialize struct type received more than one of the
same field.