1
0
Fork 0
mirror of synced 2024-06-01 18:29:38 +12:00

Found the error, removing printing of full traceback

This commit is contained in:
phxntxm 2016-07-15 18:21:38 -05:00
parent 59c6fcc868
commit 1fd71e3943

8
bot.py
View file

@ -63,10 +63,10 @@ async def on_command_error(error, ctx):
elif isinstance(error, commands.CheckFailure):
fmt = "You can't tell me what to do!"
await bot.send_message(ctx.message.channel, fmt)
elif isinstance(error, commands.CommandInvokeError):
print('In {0.command.qualified_name}:'.format(ctx), file=sys.stderr)
traceback.print_tb(error.original.__traceback__)
print('{0.__class__.__name__}: {0}'.format(error.original), file=sys.stderr)
#elif isinstance(error, commands.CommandInvokeError):
#print('In {0.command.qualified_name}:'.format(ctx), file=sys.stderr)
#traceback.print_tb(error.original.__traceback__)
#print('{0.__class__.__name__}: {0}'.format(error.original), file=sys.stderr)
else:
fmt = 'An error occurred while processing this request: ```py\n{}: {}\n```'
await bot.send_message(ctx.message.channel, fmt.format(type(error).__name__, error))