xml: Some work on errors

This commit is contained in:
Lennart
2025-02-06 14:06:17 +01:00
parent 9b6ad4eb39
commit 6caa04a516
9 changed files with 37 additions and 33 deletions

View File

@@ -30,7 +30,9 @@ impl ValueDeserialize for UtcDateTime {
Ok(Self(
NaiveDateTime::parse_from_str(&input, UTC_DATE_TIME)
.map_err(|_| {
rustical_xml::XmlError::Other("Could not parse as UTC timestamp".to_owned())
rustical_xml::XmlError::InvalidValue(rustical_xml::ParseValueError::Other(
"Could not parse as UTC timestamp".to_owned(),
))
})?
.and_utc(),
))