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

Attempting to print full traceback to error file

This commit is contained in:
Phxntxm 2016-07-18 14:57:23 -05:00
parent 50e7d6a6e6
commit 66522af1b6

2
bot.py
View file

@ -1,6 +1,7 @@
#!/usr/local/bin/python3.5
import discord
import traceback
from discord.ext import commands
from cogs.utils import config
@ -62,7 +63,6 @@ async def on_command_error(error, ctx):
await bot.send_message(ctx.message.channel, fmt.format(type(error).__name__, error))
with open("/home/phxntx5/public_html/Bonfire/error_log", 'w') as f:
print('In {0.command.qualified_name}:'.format(ctx), file=f)
traceback.print_tb(error.__traceback__, file=f)
traceback.print_tb(error.original.__traceback__, file=f)
print('{0.__class__.__name__}: {0}'.format(error.original), file=f)