If a conversion is tried on a non-existing infraction, it should be gracefully handled instead of throwing a 404 exception.
ResponseCodeError: Status: 404 Response: {'detail': 'Not found.'}
File "bot/api.py", line 67, in maybe_raise_for_status
raise ResponseCodeError(response=response, response_json=response_json)
File "bot/api.py", line 75, in request
await self.maybe_raise_for_status(resp, raise_for_status)
File "bot/api.py", line 80, in get
return await self.request("GET", endpoint, raise_for_status=raise_for_status, **kwargs)
File "bot/converters.py", line 578, in convert
return await ctx.bot.api_client.get(f"bot/infractions/{arg}")
File "discord/ext/commands/core.py", line 451, in _actual_conversion
ret = await instance.convert(ctx, argument)
ConversionError: (<class 'bot.converters.Infraction'>, ResponseCodeError())
File "discord/ext/commands/core.py", line 464, in _actual_conversion
raise ConversionError(converter, exc) from exc
File "discord/ext/commands/core.py", line 505, in do_conversion
return await self._actual_conversion(ctx, converter, argument, param)
File "discord/ext/commands/core.py", line 552, in transform
return await self.do_conversion(ctx, converter, argument, param)
File "discord/ext/commands/core.py", line 697, in _parse_arguments
transformed = await self.transform(ctx, param)
File "discord/ext/commands/core.py", line 790, in prepare
await self._parse_arguments(ctx)
...
(3 additional frame(s) were not displayed)
Error executing command invoked by [REDACTED]: !i e 26984Bye bye | [REDACTED]
If a conversion is tried on a non-existing infraction, it should be gracefully handled instead of throwing a 404 exception.
Sentry Issue: BOT-M2