]> code.octet-stream.net Git - m17rt/blobdiff - m17app/src/error.rs
Correctly call all adapter lifecycle methods, docs and test
[m17rt] / m17app / src / error.rs
index ee624f9257c9a873824cb475fd2f471268a629d0..c1bcac1e2950da9b5cdffb1e58e6f6cf1df87007 100644 (file)
@@ -1,6 +1,8 @@
+use std::path::PathBuf;
+
 use thiserror::Error;
 
 use thiserror::Error;
 
-#[derive(Debug, Error)]
+#[derive(Debug, Error, PartialEq, Eq, Clone)]
 pub enum M17Error {
     #[error("given callsign contains at least one character invalid in M17: {0}")]
     InvalidCallsignCharacters(char),
 pub enum M17Error {
     #[error("given callsign contains at least one character invalid in M17: {0}")]
     InvalidCallsignCharacters(char),
@@ -13,4 +15,18 @@ pub enum M17Error {
 
     #[error("unable to locate sound card '{0}' - is it in use?")]
     SoundcardNotFound(String),
 
     #[error("unable to locate sound card '{0}' - is it in use?")]
     SoundcardNotFound(String),
+
+    #[error("unable to set up RTL-SDR receiver")]
+    RtlSdrInit,
+
+    #[error(
+        "provided packet payload is too large: provided {provided} bytes, capacity {capacity}"
+    )]
+    PacketTooLarge { provided: usize, capacity: usize },
+
+    #[error("provided path to RRC file could not be opened: {0}")]
+    InvalidRrcPath(PathBuf),
+
+    #[error("failed to read from RRC file: {0}")]
+    RrcReadFailed(PathBuf),
 }
 }