use core::num::{ParseIntError, TryFromIntError};
use thiserror::Error as ThisError;
#[derive(Clone, Debug, Eq, PartialEq, ThisError)]
#[non_exhaustive]
pub enum ConversionError {
#[error("Empty value")]
EmptyValue,
#[error("Invalid digit: {0}")]
InvalidDigit(char),
#[error("Invalid digit for base {1}: {0}")]
InvalidRadix(char, u8),
#[error("Invalid integer: {0}")]
ParseIntError(#[from] ParseIntError),
#[error("Invalid integer for destination type: {0}")]
TryFromIntError(#[from] TryFromIntError),
#[error("Value is negative")]
ValueIsNegative,
#[error("Value too large")]
ValueTooLarge,
}