mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
Catch OverflowErrors in the timedelta converter (#4630)
This commit is contained in:
parent
06ba425159
commit
e519286f5c
@ -112,7 +112,12 @@ def parse_timedelta(
|
|||||||
_("`{unit}` is not a valid unit of time for this command").format(unit=k)
|
_("`{unit}` is not a valid unit of time for this command").format(unit=k)
|
||||||
)
|
)
|
||||||
if params:
|
if params:
|
||||||
delta = timedelta(**params)
|
try:
|
||||||
|
delta = timedelta(**params)
|
||||||
|
except OverflowError:
|
||||||
|
raise BadArgument(
|
||||||
|
_("The time set is way too high, consider setting something reasonable.")
|
||||||
|
)
|
||||||
if maximum and maximum < delta:
|
if maximum and maximum < delta:
|
||||||
raise BadArgument(
|
raise BadArgument(
|
||||||
_(
|
_(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user