mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 10:32:19 +00:00
minor improvements to rustical_xml errors
This commit is contained in:
@@ -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(),
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user