X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/0ae30668b7142e60de9efcc6e2e2724f9ec77962..HEAD:/m17codec2/src/error.rs?ds=sidebyside diff --git a/m17codec2/src/error.rs b/m17codec2/src/error.rs index ccf94b9..b1b3e62 100644 --- a/m17codec2/src/error.rs +++ b/m17codec2/src/error.rs @@ -2,6 +2,9 @@ use thiserror::Error; #[derive(Debug, Error)] pub enum M17Codec2Error { + #[error("tried to start adapter more than once")] + RepeatStart, + #[error("selected card '{0}' does not exist or is in use")] CardUnavailable(String), @@ -11,7 +14,9 @@ pub enum M17Codec2Error { #[error("selected card '{0}' failed to list available output configs: '{1}'")] OutputConfigsUnavailable(String, #[source] cpal::SupportedStreamConfigsError), - #[error("selected card '{0}' did not offer a compatible output config type, either due to hardware limitations or because it is currently in use")] + #[error( + "selected card '{0}' did not offer a compatible output config type, either due to hardware limitations or because it is currently in use" + )] SupportedOutputUnavailable(String), #[error("selected card '{0}' was unable to build an output stream: '{1}'")] @@ -19,4 +24,18 @@ pub enum M17Codec2Error { #[error("selected card '{0}' was unable to play an output stream: '{1}'")] OutputStreamPlayError(String, #[source] cpal::PlayStreamError), + + #[error("selected card '{0}' failed to list available input configs: '{1}'")] + InputConfigsUnavailable(String, #[source] cpal::SupportedStreamConfigsError), + + #[error( + "selected card '{0}' did not offer a compatible input config type, either due to hardware limitations or because it is currently in use" + )] + SupportedInputUnavailable(String), + + #[error("selected card '{0}' was unable to build an input stream: '{1}'")] + InputStreamBuildError(String, #[source] cpal::BuildStreamError), + + #[error("selected card '{0}' was unable to play an input stream: '{1}'")] + InputStreamPlayError(String, #[source] cpal::PlayStreamError), }