osu_file_parser/osu_file/difficulty/error.rs
1use thiserror::Error;
2
3use crate::helper::macros::unreachable_err_impl;
4
5#[derive(Debug, Error)]
6#[non_exhaustive]
7/// Error used when there was a problem parsing the `Difficulty` section.
8pub enum ParseError {
9 /// When the line isn't in a `key: value` format.
10 #[error("Invalid colon set, expected format of `key: value`")]
11 InvalidColonSet,
12 /// Invalid key name was used.
13 #[error("The key doesn't exist in `Difficulty`")]
14 InvalidKey,
15 /// There is a duplicate field in `Difficulty`.
16 #[error("Duplicate field in `Difficulty`")]
17 DuplicateField,
18}
19
20unreachable_err_impl!(ParseError);