Skip to main content

asimov_id/
handle_error.rs

1// This is free and unencumbered software released into the public domain.
2
3use thiserror::Error;
4
5#[derive(Clone, Debug, Eq, Error, Hash, Ord, PartialEq, PartialOrd)]
6pub enum HandleError {
7    #[error("empty input")]
8    EmptyInput,
9
10    #[error("invalid length: {0}")]
11    InvalidLength(usize),
12
13    #[error("invalid first character: {0}")]
14    InvalidFirstChar(char),
15
16    #[error("invalid character: {0}")]
17    InvalidChar(char),
18}