use std::num::{ParseFloatError, ParseIntError};
use thiserror::Error;
#[derive(Debug, Clone, Error)]
pub enum UnitsError {
#[error("incorrect units: {0}")]
Other(String),
}
#[derive(Debug, Clone, Error)]
pub enum ValueError {
#[error("incorrect integer value: {0:?}")]
ParseIntError(ParseIntError),
#[error("incorrect floating point value: {0:?}")]
ParseFloatError(ParseFloatError),
}
#[derive(Debug, Clone, Error)]
pub enum InvalidValueParseError {
#[error("incorrect message field invalid value specification: {0}")]
IncorrectSpecification(String),
#[error("message field invalid value specification parsing error: {0:?}")]
IncorrectValue(String, ValueError),
#[error("error: {0:?}")]
Other(String),
}
#[derive(Debug, Clone, Error)]
pub enum TypeParseError {
#[error("field type has an invalid array specification: {0}")]
ArrayTypeLengthError(String, ParseIntError),
#[error("arrays of arrays are not allowed: {0}")]
NestedArraysAreNotSupportedError(String),
#[error("invalid type specification: {0}")]
Other(String),
}