Merge pull request 'ent done-time ISSUE TIME: report parse error instead of panicking' (#28) from fix-done-time-parsing into main
Reviewed-on: #28
This commit is contained in:
commit
44a6ac5110
1 changed files with 7 additions and 3 deletions
|
|
@ -510,9 +510,13 @@ fn handle_command(
|
|||
let Some(issue) = issues.get_mut_issue(issue_id) else {
|
||||
return Err(anyhow::anyhow!("issue {} not found", issue_id));
|
||||
};
|
||||
let done_time = chrono::DateTime::parse_from_rfc3339(done_time)
|
||||
.unwrap()
|
||||
.with_timezone(&chrono::Local);
|
||||
let done_time = match chrono::DateTime::parse_from_rfc3339(done_time) {
|
||||
Ok(done_time) => done_time.with_timezone(&chrono::Local),
|
||||
Err(e) => {
|
||||
eprintln!("failed to parse done-time from {}", done_time);
|
||||
return Err(e.into());
|
||||
}
|
||||
};
|
||||
issue.set_done_time(done_time)?;
|
||||
}
|
||||
None => match &issue.done_time {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue