encoded_words/
defects.rs

1//! Defects
2
3use thiserror::Error;
4
5/// These are parsing defects which the parser was able to work around.
6#[derive(Debug, Clone, Error, PartialEq, Eq)]
7pub enum Defect {
8    #[error("Header contained bytes that could not be decoded")]
9    UndecodableBytes,
10    #[error("base64 encoded sequence had an incorrect length")]
11    InvalidBase64Padding,
12    #[error(
13        "base64 encoded sequence had characters not in base64 alphabet: {}",
14        byte
15    )]
16    InvalidBase64Characters { byte: u8 },
17    #[error("base64 encoded sequence had invalid length (1 mod 4)")]
18    InvalidBase64Length,
19    #[error(
20        "ASCII characters outside the ascii-printable range found: {:?}",
21        non_printables
22    )]
23    NonPrintable { non_printables: Vec<u8> },
24    #[error("An illegal charset was given: {}", charset)]
25    InvalidCharset { charset: String },
26}