Skip to content

Commit

Permalink
Improve error message for "failed to parse start time"
Browse files Browse the repository at this point in the history
Report the actual start_time value that couldn't be parsed so it's
clearer when gcalcli is doing something silly like interpreting
--calendar=Foo as a positional arg (see #697).
  • Loading branch information
dbarnett committed Aug 24, 2024
1 parent 1000154 commit 4056838
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gcalcli/gcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ def CalQuery(self, cmd, start_text='', count=1):
start = start.replace(hour=0, minute=0, second=0,
microsecond=0)
except Exception:
self.printer.err_msg('Error: failed to parse start time\n')
self.printer.err_msg(f'Error: failed to parse start time {start_text!r}\n')
return

# convert start date to the beginning of the week or month
Expand Down

0 comments on commit 4056838

Please sign in to comment.