From 89981f46b09e495191a8c6874341216eb3d06863 Mon Sep 17 00:00:00 2001 From: Will Date: Sun, 19 Nov 2017 17:33:33 -0500 Subject: [PATCH] Fix reload error handling (#1104) --- redbot/core/core_commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index ac1318179..9a535ebe1 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -80,8 +80,9 @@ class Core: """Reloads a package""" ctx.bot.unload_extension(cog_name) - spec = await ctx.bot.cog_mgr.find_cog(cog_name) - if spec is None: + try: + spec = await ctx.bot.cog_mgr.find_cog(cog_name) + except RuntimeError: await ctx.send(_("No module by that name was found in any" " cog path.")) return