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"""
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