aboutsummaryrefslogtreecommitdiff
path: root/src/uid.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/uid.rs')
-rw-r--r--src/uid.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/uid.rs b/src/uid.rs
index 6361638..ad18b7e 100644
--- a/src/uid.rs
+++ b/src/uid.rs
@@ -20,13 +20,13 @@ impl<'de> Visitor<'de> for UIDVisitor {
if v.len() == 4 {
match hex::decode(v) {
Ok(n) => Ok(UID(n[0], n[1])),
- Err(_) => panic!()
+ Err(_) => Err(serde::de::Error::custom("Could not decode hex"))
}
} else {
- panic!()
+ Err(serde::de::Error::custom("ID must be a 2 byte hex string \'0000\'-\"FFFF\""))
}
} else {
- panic!()
+ Err(serde::de::Error::custom("Invalid characters in string"))
}
}
}