osu_file_parser/osu_file/events/
error.rs

1use thiserror::Error;
2
3use super::{storyboard::error::*, *};
4
5/// Errors used when there was a problem parsing an [`Event`][super::Event] from a `str`.
6#[derive(Debug, Error)]
7#[non_exhaustive]
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 `General`")]
14    InvalidKey,
15    /// A `storyboard` `command` was used without defined sprite or animation sprite.
16    #[error("A storyboard command was used without defined sprite or animation sprite")]
17    StoryboardCmdWithNoSprite,
18    #[error(transparent)]
19    ParseBackgroundError(#[from] ParseBackgroundError),
20    #[error(transparent)]
21    ParseVideoError(#[from] ParseVideoError),
22    #[error(transparent)]
23    ParseBreakError(#[from] ParseBreakError),
24    #[error(transparent)]
25    ParseColourTransformationError(#[from] ParseColourTransformationError),
26    #[error(transparent)]
27    ParseSpriteLegacyError(#[from] ParseSpriteLegacyError),
28    #[error(transparent)]
29    ParseAnimationLegacyError(#[from] ParseAnimationLegacyError),
30    #[error(transparent)]
31    ParseSampleLegacyError(#[from] ParseSampleLegacyError),
32    #[error(transparent)]
33    CommandPushError(#[from] CommandPushError),
34    #[error(transparent)]
35    ParseCommandError(#[from] ParseCommandError),
36    /// There was a problem parsing some `storyboard` element.
37    #[error(transparent)]
38    ParseStoryboardObjectError(#[from] ParseObjectError),
39    #[error(transparent)]
40    ParseAudioSampleError(#[from] ParseAudioSampleError),
41    /// Event doesn't exist on the version.
42    #[error("Event type doesn't exist on version")]
43    EventNotExistOnVersion,
44    /// Unknown event type.
45    #[error("Unknown event type")]
46    UnknownEventType,
47}