osu_file_parser/osu_file/editor/
error.rs

1use std::num::ParseIntError;
2
3use thiserror::Error;
4
5use crate::helper::macros::unreachable_err_impl;
6
7#[derive(Debug, Error)]
8#[non_exhaustive]
9/// Error used when there was a problem parsing the `Editor` section.
10pub enum ParseError {
11    /// A Field in `Editor` failed to parse as a `Integer`.
12    #[error(transparent)]
13    ParseIntError(#[from] ParseIntError),
14    /// When the line isn't in a `key: value` format.
15    #[error("Invalid colon set, expected format of `key: value`")]
16    InvalidColonSet,
17    /// Invalid key name was used.
18    #[error("The key doesn't exist in `Editor`")]
19    InvalidKey,
20    /// Invalid comma list, expected format of `key: value, value, value, ...`
21    #[error("Invalid comma list, expected format of `key: value, value, value, ...`")]
22    InvalidCommaList,
23    /// Duplicate field in `Editor`.
24    #[error("Duplicate field in `Editor`")]
25    DuplicateField,
26}
27
28unreachable_err_impl!(ParseError);