aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdebdate9
1 files changed, 7 insertions, 2 deletions
diff --git a/debdate b/debdate
index 39af2ea..e602f63 100755
--- a/debdate
+++ b/debdate
@@ -34,6 +34,7 @@ RELEASES = [
(datetime.date(1996, 6, 17), 'buzz'),
]
MSG = "Today is day {dody} of year {yodr} of the {release}"
+ERR_MSG = "Today is {isodate} of the Debianless Age"
class DebDate:
@@ -160,8 +161,12 @@ class Command:
else:
date = datetime.date.today()
debdate = DebDate()
- data = debdate.get_release(date)
- print(MSG.format(**data))
+ try:
+ data = debdate.get_release(date)
+ except OutsideTimeError:
+ print(ERR_MSG.format(isodate=date.strftime("%Y-%m-%d")))
+ else:
+ print(MSG.format(**data))
def main(self):
self.setup_parser()