simple_game_utils/
error.rs1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum GameUtilError {
5 #[cfg(feature = "sound")]
6 #[error("Error init'ing sound effect: {0}")]
7 SoundEffectInit(&'static str),
8 #[cfg(feature = "sound")]
9 #[error("Invalid sound data")]
10 SoundEffectInvalid(hound::Error),
11 #[cfg(feature = "prefs")]
12 #[error("Unable to get app pref dir")]
13 AppPrefDir,
14 #[cfg(feature = "prefs")]
15 #[error("Saving prefs: {0} to {1}")]
16 Saving(String, String),
17 #[cfg(feature = "prefs")]
18 #[error("Serializing data: {0}")]
19 Serializing(String),
20 #[cfg(feature = "prefs")]
21 #[error("Loading prefs: {0} from {1}")]
22 Loading(String, String),
23 #[cfg(feature = "prefs")]
24 #[error("Deserializing data: {0}")]
25 Deserializing(String),
26 #[cfg(feature = "prefs")]
27 #[error("Creating pref dir: {0} at {1}")]
28 MakingDirs(String, String),
29 #[error("Tileset for {0} is missing images: {1:?}")]
30 InvalidTileset(String, Vec<String>),
31}