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,9 @@ impl Value for UtcDateTime {
let input = <String as Value>::deserialize(val)?;
Ok(Self(
NaiveDateTime::parse_from_str(&input, UTC_DATE_TIME)
// TODO: proper error
.map_err(|_| rustical_xml::XmlDeError::UnknownError)?
.map_err(|_| {
rustical_xml::XmlDeError::Other("Could not parse as UTC timestamp".to_owned())
})?
.and_utc(),
))
}