luminol_audio/error.rs
1// Copyright (C) 2024 Melody Madeline Lyons
2//
3// This file is part of Luminol.
4//
5// Luminol is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Luminol is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Luminol. If not, see <http://www.gnu.org/licenses/>.
17//
18// Additional permission under GNU GPL version 3 section 7
19//
20// If you modify this Program, or any covered work, by linking or combining
21// it with Steamworks API by Valve Corporation, containing parts covered by
22// terms of the Steamworks API by Valve Corporation, the licensors of this
23// Program grant you additional permission to convey the resulting work.
24
25#[derive(Debug, thiserror::Error)]
26pub enum Error {
27 #[error("An error occured while decoding an audio file: {0}")]
28 DecoderError(#[from] rodio::decoder::DecoderError),
29 #[error("An error occured while creating a synthesizer: {0}")]
30 SynthesizerError(#[from] rustysynth::SynthesizerError),
31 #[error("An error occured while playing a midi track: {0}")]
32 MidiError(#[from] rustysynth::MidiFileError),
33 #[error("An error occured while playing a track: {0}")]
34 PlayError(#[from] rodio::PlayError),
35 #[error("An error occured while reading a file from the filesystem: {0}")]
36 FileSystem(#[from] luminol_filesystem::Error),
37}
38
39pub use color_eyre::Result;