diff options
| author | Pinapelz <yukais@pinapelz.com> | 2023-12-08 00:28:25 -0800 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2023-12-08 00:28:25 -0800 |
| commit | e1df1ff16bce76bb3c21d80e96db08b5a1ec28a2 (patch) | |
| tree | 2a0057d6c12cfaaf3a4d3108c6e1f8db4af662da | |
| parent | 591255b19687ae659f290c83a1471be9e4299489 (diff) | |
raise overflow error if projection is negative
| -rw-r--r-- | backend/app.py | 2 |
1 files changed, 2 insertions, 0 deletions
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) |
