]> code.octet-stream.net Git - m17rt/blobdiff - m17codec2/src/error.rs
Add basic m17rt-netclient tool
[m17rt] / m17codec2 / src / error.rs
index ccf94b9894226905a2d538b3aa7aecac9d285531..7fa6583f1f3af20521d5895829a7bfcef30af7ef 100644 (file)
@@ -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),
 
@@ -19,4 +22,16 @@ 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),
 }