use std::num::ParseIntError;
use thiserror::Error;
use crate::helper::{macros::unreachable_err_impl, ParseZeroOneBoolError};
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ParseError {
#[error(transparent)]
ParseIntError(#[from] ParseIntError),
#[error(transparent)]
ParseZeroOneBoolError(#[from] ParseZeroOneBoolError),
#[error(transparent)]
ParseCountdownSpeedError(#[from] ParseCountdownSpeedError),
#[error(transparent)]
ParseGameModeError(#[from] ParseGameModeError),
#[error(transparent)]
ParseSampleSetError(#[from] ParseSampleSetError),
#[error(transparent)]
ParseOverlayPositionError(#[from] ParseOverlayPositionError),
#[error("Invalid colon set, expected format of `key: value`")]
InvalidColonSet,
#[error("The key doesn't exist in `General`")]
InvalidKey,
#[error("Duplicate field were found in `General`")]
DuplicateField,
#[error("Field doesn't exist in version")]
InvalidVersion,
#[error("Invalid comma list, expected format of `key: value, value, value, ...`")]
InvalidCommaList,
}
unreachable_err_impl!(ParseError);
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ParseGameModeError {
#[error("Unknown `GameMode` variant")]
UnknownVariant,
#[error(transparent)]
ParseError(#[from] ParseIntError),
}
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ParseCountdownSpeedError {
#[error("Unknown `CountdownSpeed` variant")]
UnknownVariant,
#[error("There was a problem parsing the `str` as an `Integer`")]
ParseError(#[from] ParseIntError),
}
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ParseOverlayPositionError {
#[error("Unknown `OverlayPosition` variant")]
UnknownVariant,
}
#[derive(Debug, Error)]
#[non_exhaustive]
pub enum ParseSampleSetError {
#[error("Unknown `SampleSet` variant")]
UnknownVariant,
}