minor improvements to rustical_xml errors

This commit is contained in:
Lennart
2025-01-04 20:03:56 +01:00
parent fd4ed57775
commit a304714de8
7 changed files with 38 additions and 17 deletions

View File

@@ -26,8 +26,11 @@ impl Value for SyncLevel {
Ok(match val {
"1" => Self::One,
"Infinity" => Self::Infinity,
// TODO: proper error
_ => return Err(rustical_xml::XmlDeError::UnknownError),
_ => {
return Err(rustical_xml::XmlDeError::Other(
"Invalid sync-level".to_owned(),
))
}
})
}
fn serialize(&self) -> String {