osu_file_parser/osu_file/metadata/
error.rs

1use thiserror::Error;
2
3use std::num::ParseIntError;
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 `Metadata` section.
10pub enum ParseError {
11    /// There is a duplicate field in the `Metadata` section.
12    #[error("There is a duplicate field in the `Metadata` section")]
13    DuplicateField,
14    /// A Field in `Metadata` failed to parse as a `Integer`.
15    #[error(transparent)]
16    ParseIntError(#[from] ParseIntError),
17    /// When the line isn't in a `key: value` format.
18    #[error("Invalid colon set, expected format of `key: value`")]
19    InvalidColonSet,
20    /// Invalid key name was used.
21    #[error("The key doesn't exist in `General`")]
22    InvalidKey,
23}
24
25unreachable_err_impl!(ParseError);