diff options
| author | 2021-01-28 21:57:54 +0000 | |
|---|---|---|
| committer | 2021-01-28 21:57:54 +0000 | |
| commit | 9dea9e6fa57682b94b93f7ff6567d58862ada7ed (patch) | |
| tree | 312ed7f75f6b8e731be5214b555efeffb668096b | |
| parent | Merge pull request #1372 from anand2312/duckpond-check (diff) | |
catch the response error and deal with it
| -rw-r--r-- | bot/converters.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/converters.py b/bot/converters.py index d0a9731d6..880b1fe38 100644 --- a/bot/converters.py +++ b/bot/converters.py @@ -575,7 +575,10 @@ class Infraction(Converter): return infractions[0] else: - return await ctx.bot.api_client.get(f"bot/infractions/{arg}") + try: + return await ctx.bot.api_client.get(f"bot/infractions/{arg}") + except ResponseCodeError: + raise BadArgument("The provided infraction could not be found.") Expiry = t.Union[Duration, ISODateTime] |