[refactor]: Clear error handling
This commit is contained in:
parent
f427fb38a2
commit
dad2f4abea
@ -12,11 +12,7 @@ class ErrHandler(Cog):
|
||||
bot.tree.error(self.on_error)
|
||||
|
||||
async def on_error(self, inter, error):
|
||||
logger.error(error)
|
||||
logger.warning(print_exc())
|
||||
info = exc_info()
|
||||
logger.error(info)
|
||||
logger.error(print_tb(info[2]))
|
||||
logger.error(print_exc())
|
||||
|
||||
errors_text = await self.bot.tree.translator.translate(
|
||||
app_commands.locale_str("errors_text"),
|
||||
|
@ -1,6 +1,7 @@
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from loguru import logger
|
||||
from traceback import print_tb
|
||||
|
||||
class Errors(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
@ -27,7 +28,8 @@ class Errors(commands.Cog):
|
||||
elif isinstance(error, commands.CheckFailure):
|
||||
await ctx.send('Команда недоступна')
|
||||
else:
|
||||
logger.error(error.__traceback__)
|
||||
logger.debug(error)
|
||||
logger.error(print_tb(error))
|
||||
# missing = [perm.replace('_', ' ').replace('guild', 'server').title() for perm in error.missing_perms]
|
||||
# if len(missing) > 2:
|
||||
# fmt = '{}, и {}'.format("**, **".join(missing[:-1]), missing[-1])
|
||||
|
Reference in New Issue
Block a user