use thiserror::Error;
#[derive(Debug, Clone, Copy, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum DeterministicCborProfileError {
#[error("deterministic CBOR: negative integer must be less than zero")]
NegativeIntegerMustBeNegative,
}
#[derive(Debug, Clone, Copy, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum DeterministicCborError {
#[error("deterministic CBOR: trailing bytes after top-level value")]
TrailingBytes,
#[error("deterministic CBOR: unexpected end of input")]
UnexpectedEnd,
#[error("deterministic CBOR: input too large")]
InputTooLarge,
#[error("deterministic CBOR: encoded output too large")]
OutputTooLarge,
#[error("deterministic CBOR: offset arithmetic overflow")]
OffsetOverflow,
#[error("deterministic CBOR: length does not fit in platform usize")]
LengthTooLarge,
#[error("deterministic CBOR: negative integer outside supported range")]
NegativeIntegerOutOfRange,
#[error("deterministic CBOR: negative integer must be less than zero")]
NegativeIntegerMustBeNegative,
#[error("deterministic CBOR: non-canonical integer or length encoding")]
NonCanonicalInteger,
#[error("deterministic CBOR: truncated numeric argument")]
TruncatedArgument,
#[error("deterministic CBOR: truncated byte or text string")]
TruncatedBytes,
#[error("deterministic CBOR: invalid UTF-8 string")]
InvalidUtf8,
#[error("deterministic CBOR: unsupported map key type")]
UnsupportedMapKeyType,
#[error("deterministic CBOR: duplicate map key")]
DuplicateMapKey,
#[error("deterministic CBOR: map keys out of deterministic order")]
MapKeysOutOfOrder,
#[error("deterministic CBOR: unsupported simple value")]
UnsupportedSimpleValue,
#[error("deterministic CBOR: unsupported major type")]
UnsupportedMajorType,
#[error("deterministic CBOR: unsupported additional information")]
UnsupportedAdditionalInfo,
#[error("deterministic CBOR: nesting depth limit exceeded")]
DepthExceeded,
#[error("deterministic CBOR: node limit exceeded")]
NodeLimitExceeded,
#[error("deterministic CBOR: container entry limit exceeded")]
ContainerEntriesExceeded,
#[error("deterministic CBOR: aggregate text byte limit exceeded")]
AggregateTextBytesExceeded,
#[error("deterministic CBOR: aggregate byte-string limit exceeded")]
AggregateByteStringBytesExceeded,
#[error("deterministic CBOR: declared container length exceeds remaining input")]
ContainerLengthExceedsInput,
#[error("deterministic CBOR: preflight length mismatch")]
PreflightLengthMismatch,
#[error("deterministic CBOR: bounded allocation failed")]
AllocationFailure,
}
impl From<DeterministicCborProfileError> for DeterministicCborError {
fn from(error: DeterministicCborProfileError) -> Self {
match error {
DeterministicCborProfileError::NegativeIntegerMustBeNegative => {
Self::NegativeIntegerMustBeNegative
}
}
}
}