Skip to content

Handle out of range year in Duration converter #906

@sentry

Description

@sentry

Sentry Issue: BOT-39

As documented here, it has to be MINYEAR <= year <= MAXYEAR which is effectively 1 <= year <= 9999

ValueError: year 104039 is out of range
  File "discord/ext/commands/core.py", line 425, in _actual_conversion
    ret = await instance.convert(ctx, argument)
  File "bot/converters.py", line 220, in convert
    return now + delta
  File "dateutil/relativedelta.py", line 405, in __radd__
    return self.__add__(other)
  File "dateutil/relativedelta.py", line 387, in __add__
    ret = (other.replace(**repl)

Metadata

Metadata

Assignees

Labels

a: backendRelated to internal functionality and utilities (error_handler, logging, security, utils and core)p: 2 - normalNormal Prioritys: WIPWork In Progresst: bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions