diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-30 12:36:53 +0200 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-03-30 15:25:56 +0200 |
| commit | 950158eaadd8db9ef0eb48187e825524499422d3 (patch) | |
| tree | 381093bd7033e5181aab3119c832ac7cbd015259 /mumd/src/error.rs | |
| parent | 25687fb7c98f7d7d8b1f0a04d32092f394ec4c44 (diff) | |
| download | mum-950158eaadd8db9ef0eb48187e825524499422d3.tar.gz | |
config error
Diffstat (limited to 'mumd/src/error.rs')
| -rw-r--r-- | mumd/src/error.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mumd/src/error.rs b/mumd/src/error.rs index a171f1f..84c1958 100644 --- a/mumd/src/error.rs +++ b/mumd/src/error.rs @@ -1,3 +1,4 @@ +use mumlib::error::ConfigError; use std::fmt; pub enum AudioStream { @@ -36,6 +37,7 @@ impl fmt::Display for AudioError { pub enum StateError { AudioError(AudioError), + ConfigError(ConfigError), } impl From<AudioError> for StateError { @@ -44,10 +46,17 @@ impl From<AudioError> for StateError { } } +impl From<ConfigError> for StateError { + fn from(e: ConfigError) -> Self { + StateError::ConfigError(e) + } +} + impl fmt::Display for StateError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { StateError::AudioError(e) => write!(f, "Audio error: {}", e), + StateError::ConfigError(e) => write!(f, "Config error: {}", e), } } } |
