use std::num::{ParseFloatError, ParseIntError};
use thiserror::Error;
#[derive(Debug, Clone, Error)]
pub enum ParseError {
#[error("invalid units")]
UnitsError(String),
}
#[derive(Debug, Clone, Error)]
pub enum ValueParseError {
#[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, ValueParseError),
}
#[derive(Debug, Clone, Error)]
pub enum TypeParseError {
#[error("invalid type specification: {0}")]
Error(String),
#[error("field type has an invalid array specification: {0}")]
ArrayTypeLengthError(String, ParseIntError),
#[error("arrays of arrays are not allowed: {0}")]
NestedArraysAreNotSupportedError(String),
}