mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 20:28:55 -05:00
load and reload command errors available with the [p]traceback command (#1307)
This commit is contained in:
parent
a0327a62dd
commit
3984cb8f48
@ -3,6 +3,7 @@ import importlib
|
||||
import itertools
|
||||
import logging
|
||||
import sys
|
||||
import traceback
|
||||
from collections import namedtuple
|
||||
from random import SystemRandom
|
||||
from string import ascii_letters, digits
|
||||
@ -229,6 +230,13 @@ class Core:
|
||||
await ctx.bot.load_extension(spec)
|
||||
except Exception as e:
|
||||
log.exception("Package loading failed", exc_info=e)
|
||||
|
||||
exception_log = ("Exception in command '{}'\n"
|
||||
"".format(ctx.command.qualified_name))
|
||||
exception_log += "".join(traceback.format_exception(type(e),
|
||||
e, e.__traceback__))
|
||||
self.bot._last_exception = exception_log
|
||||
|
||||
await ctx.send(_("Failed to load package. Check your console or "
|
||||
"logs for details."))
|
||||
else:
|
||||
@ -264,6 +272,13 @@ class Core:
|
||||
await ctx.bot.load_extension(spec)
|
||||
except Exception as e:
|
||||
log.exception("Package reloading failed", exc_info=e)
|
||||
|
||||
exception_log = ("Exception in command '{}'\n"
|
||||
"".format(ctx.command.qualified_name))
|
||||
exception_log += "".join(traceback.format_exception(type(e),
|
||||
e, e.__traceback__))
|
||||
self.bot._last_exception = exception_log
|
||||
|
||||
await ctx.send(_("Failed to reload package. Check your console or "
|
||||
"logs for details."))
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user