commonware_codec/
error.rs1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum Error {
8 #[error("Unexpected End-of-Buffer")]
9 EndOfBuffer,
10 #[error("Extra Data: {0} bytes")]
11 ExtraData(usize),
12 #[error("Length Exceeded: {0} > {1}")]
13 LengthExceeded(usize, usize), #[error("Invalid Varint")]
15 InvalidVarint,
16 #[error("Invalid Bool")]
17 InvalidBool,
18 #[error("Invalid. Context({0}), Message({1})")]
19 Invalid(&'static str, &'static str),
20 #[error("Invalid. Context({0}), Error({1})")]
21 Wrapped(&'static str, Box<dyn std::error::Error + Send + Sync>),
22}