From e1df1ff16bce76bb3c21d80e96db08b5a1ec28a2 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Fri, 8 Dec 2023 00:28:25 -0800 Subject: raise overflow error if projection is negative --- backend/app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/app.py b/backend/app.py index 46336f6..e042a35 100644 --- a/backend/app.py +++ b/backend/app.py @@ -110,6 +110,8 @@ def get_channel_information(channel_name): days_until_next_milestone_scalar = int(days_until_next_milestone[0]) next_milestone_date = (df.index[0] + pandas.Timedelta(days=days_until_next_milestone_scalar)).date() time_until_next_milestone = (next_milestone_date - datetime.datetime.now().date()).days + if time_until_next_milestone < 0: + raise OverflowError channel_data["next_milestone_date"] = str(next_milestone_date) channel_data["days_until_next_milestone"] = str(time_until_next_milestone) channel_data["next_milestone"] = str(next_milestone) -- cgit v1.2.3