Skip to content

Gracefully handle OverflowErrors from ConversionErrors #1225

@sentry

Description

@sentry

Sentry Issue: BOT-9N

It can do a better job than displaying the raw exception message to the user.

OverflowError: signed integer is greater than maximum
  File "discord/ext/commands/core.py", line 444, in _actual_conversion
    ret = await instance.convert(ctx, argument)
  File "bot/converters.py", line 352, 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)

ConversionError: (<class 'bot.converters.Duration'>, OverflowError('signed integer is greater than maximum'))
(3 additional frame(s) were not displayed)
...
  File "discord/ext/commands/core.py", line 784, in prepare
    await self._parse_arguments(ctx)
  File "discord/ext/commands/core.py", line 690, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "discord/ext/commands/core.py", line 545, in transform
    return await self.do_conversion(ctx, converter, argument, param)
  File "discord/ext/commands/core.py", line 498, in do_conversion
    return await self._actual_conversion(ctx, converter, argument, param)
  File "discord/ext/commands/core.py", line 457, in _actual_conversion
    raise ConversionError(converter, exc) from exc

Error executing command invoked by <REDACTED>: !remind 1000000000000000y still here?

Metadata

Metadata

Assignees

Labels

a: backendRelated to internal functionality and utilities (error_handler, logging, security, utils and core)t: 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