mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
[Core] Fix error handling in loading extensions. (#2688)
* fixes 2687 * raise the right exception
This commit is contained in:
parent
3ca2a9af28
commit
0e9086ca1f
@ -261,8 +261,8 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin):
|
|||||||
lib.setup(self)
|
lib.setup(self)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._remove_module_references(lib.__name__)
|
self._remove_module_references(lib.__name__)
|
||||||
self._call_module_finalizers(lib, key)
|
self._call_module_finalizers(lib, name)
|
||||||
raise errors.ExtensionFailed(key, e) from e
|
raise errors.CogLoadError() from e
|
||||||
else:
|
else:
|
||||||
self._BotBase__extensions[name] = lib
|
self._BotBase__extensions[name] = lib
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user