From 0e9086ca1fb408a715f9601c60ac1b5819ad74fc Mon Sep 17 00:00:00 2001 From: Michael H Date: Fri, 31 May 2019 15:38:44 -0400 Subject: [PATCH] [Core] Fix error handling in loading extensions. (#2688) * fixes 2687 * raise the right exception --- redbot/core/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redbot/core/bot.py b/redbot/core/bot.py index 23f1b6ddd..142f40b5f 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -261,8 +261,8 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): lib.setup(self) except Exception as e: self._remove_module_references(lib.__name__) - self._call_module_finalizers(lib, key) - raise errors.ExtensionFailed(key, e) from e + self._call_module_finalizers(lib, name) + raise errors.CogLoadError() from e else: self._BotBase__extensions[name] = lib