Skip to content

Commit 59bd045

Browse files
authored
Fix Duration parsing not returning a range error. (#173)
Per title, parsing should return a range error and not a general error.
1 parent 96e16b1 commit 59bd045

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/duration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ impl FromStr for Duration {
880880
fn from_str(s: &str) -> Result<Self, Self::Err> {
881881
let parse_record = IsoDurationParser::from_str(s)
882882
.parse()
883-
.map_err(|e| TemporalError::general(format!("{e}")))?;
883+
.map_err(|e| TemporalError::range().with_message(format!("{e}")))?;
884884

885885
let (hours, minutes, seconds, millis, micros, nanos) = match parse_record.time {
886886
Some(TimeDurationRecord::Hours { hours, fraction }) => {

0 commit comments

Comments
 (0)