X-Git-Url: https://code.octet-stream.net/m17rt/blobdiff_plain/0165bc18338671186d2624fb23e9f0c7aff0e49f..0ae30668b7142e60de9efcc6e2e2724f9ec77962:/m17codec2/src/error.rs diff --git a/m17codec2/src/error.rs b/m17codec2/src/error.rs new file mode 100644 index 0000000..ccf94b9 --- /dev/null +++ b/m17codec2/src/error.rs @@ -0,0 +1,22 @@ +use thiserror::Error; + +#[derive(Debug, Error)] +pub enum M17Codec2Error { + #[error("selected card '{0}' does not exist or is in use")] + CardUnavailable(String), + + #[error("default output card is unavailable")] + DefaultCardUnavailable, + + #[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")] + SupportedOutputUnavailable(String), + + #[error("selected card '{0}' was unable to build an output stream: '{1}'")] + OutputStreamBuildError(String, #[source] cpal::BuildStreamError), + + #[error("selected card '{0}' was unable to play an output stream: '{1}'")] + OutputStreamPlayError(String, #[source] cpal::PlayStreamError), +}