-
-
Notifications
You must be signed in to change notification settings - Fork 6
Description
There's one detail I want to be nitpicky about in the error handler section. I'm one of the helpers from the d.py server, so this want comes from seeing what users come in with. It's often that someone sets up an error handler, and doesn't have some kind of else: do something in it, leaving them with silenced errors and no idea what to do about it.
This tutorial does have an else, but just says "oh no something went wrong", not giving any actual details about what went wrong. I'd recommend doing this:
traceback_list = traceback.format_exception(type(error), error, error.__traceback__)
traceback_format = f"```\n{''.join(traceback_list)}```"
await ctx.send(traceback_format)
This will give a nice traceback in the channel the command is sent in with the traceback needed to figure out what's going wrong.

The reason I don't like the current way it's done is for people who don't yet know that much, their first attempt will be to do await ctx.send(error) or something similar, which is simply not enough information to actually figure out the issue more times than not.