#Help with tracebacks

1 messages · Page 1 of 1 (latest)

native dragon
#

Post continued from https://discord.com/channels/789032594456576001/1132029354503831602

I cannot get traceback.format_exception here.

@listen(is_default_listener=True, disable_default_listeners=True)
    async def on_command_error(self, event: Error):
        print(event.error)
        print(event.source)
        
        if isinstance(event.error, errors.CommandOnCooldown):
            formatted_seconds = format_seconds(round(event.error.cooldown.get_cooldown_time()))
            await event.ctx.send(f"You are on cooldown. Try again in {formatted_seconds} seconds")
gray snowBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

native dragon
#

traceback.format_exception is what I cannot get

faint dust
#

try importing the traceback module and using traceback.format_exception(event.error)