caretta-sync/tripod-id/src/error.rs

29 lines
760 B
Rust
Raw Normal View History

2025-09-12 09:27:14 +09:00
#[derive(Debug, thiserror::Error)]
pub enum Error {
2025-09-13 12:29:59 +09:00
#[error("expected under {expected}, found {found}")]
OutsideOfRange{
expected: u64,
found: u64,
2025-09-13 12:29:59 +09:00
},
2025-09-12 09:27:14 +09:00
#[error("Invalid chunk: {0}")]
InvalidChunk(String),
2025-09-13 12:29:59 +09:00
#[error("Length of id expected {} or {} but found {found}: {raw}", .expected.0, .expected.1 )]
InvalidLength{
expected: (u8, u8),
found: usize,
raw: String
},
#[error("Number of chunks expected {expected} but {found}: {raw}")]
InvalidLengthOfChunks{
expected: u8,
found: usize,
raw: String,
},
#[error("Delimiter expected '-' or '_' but '{found:?}' found: {raw}")]
InvalidDelimiter{
found: Vec<char>,
raw: String,
}
2025-09-12 09:27:14 +09:00
}