diff options
author | 2021-03-11 17:59:39 +0000 | |
---|---|---|
committer | 2021-03-11 17:59:39 +0000 | |
commit | 856cffbbfa2411fa246a2ff988b1199e0dcb4030 (patch) | |
tree | a4491111c3c18951f1563d942c1f28503b753a5f | |
parent | Use a more specific filename for avatar modifiying commands (diff) |
Defer errors in pride image to error handler
-rw-r--r-- | bot/exts/evergreen/profile_pic_modification/pfp_modify.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/exts/evergreen/profile_pic_modification/pfp_modify.py b/bot/exts/evergreen/profile_pic_modification/pfp_modify.py index 299ed107..68750fe2 100644 --- a/bot/exts/evergreen/profile_pic_modification/pfp_modify.py +++ b/bot/exts/evergreen/profile_pic_modification/pfp_modify.py @@ -8,6 +8,7 @@ import aiofiles import discord from aiohttp import client_exceptions from discord.ext import commands +from discord.ext.commands.errors import BadArgument from bot.constants import Colours from bot.exts.evergreen.profile_pic_modification._effects import PfpEffects @@ -205,11 +206,9 @@ class PfpModify(commands.Cog): try: response = await session.get(url) except client_exceptions.ClientConnectorError: - await ctx.send("Cannot connect to provided URL!") - return + raise BadArgument("Cannot connect to provided URL!") except client_exceptions.InvalidURL: - await ctx.send("Invalid URL!") - return + raise BadArgument("Invalid URL!") if response.status != 200: await ctx.send("Bad response from provided URL!") |