Fix reload error handling (#1104)

This commit is contained in:
Will 2017-11-19 17:33:33 -05:00 committed by palmtree5
parent 7322f0c676
commit 89981f46b0

View File

@ -80,8 +80,9 @@ class Core:
"""Reloads a package""" """Reloads a package"""
ctx.bot.unload_extension(cog_name) ctx.bot.unload_extension(cog_name)
spec = await ctx.bot.cog_mgr.find_cog(cog_name) try:
if spec is None: spec = await ctx.bot.cog_mgr.find_cog(cog_name)
except RuntimeError:
await ctx.send(_("No module by that name was found in any" await ctx.send(_("No module by that name was found in any"
" cog path.")) " cog path."))
return return