Open lenscas opened 7 years ago
Yeah, this isn't a bad idea. I like having the stacktraces there when I'm writing code, because they help me locate bugs.
That said, nobody else can look at a stack trace and say "Oh, you probably put an extra space in there somewhere". So it might be a good idea to have the bot look at the exception it catches and make a guess as to why it was thrown, and append a line to the message giving the user a suggestion as to what went wrong. If it's an error caused by an unreadable command, it could tell the user how that command is supposed to be used.
or print the stacktrace to the console and give a nicer message to the user or if not possible a generic "something went wrong" message?
Maybe have a debug function similar to
def debug(str,debugNum): if debugNum<=CONFIG_DEBUG_MODE: print(str)
to limit the amount of stuff that gets printed to the console? As I wouldn't be surprised if most stuff we print this way don't need to be displayed unless you are actually trying to debug something
going to make a list of known errors that should be made nicer along with the current error they throw. (not the entire stack trace)
right now, a lot of errors just give stack traces in the discord chat (including from my own command). We should probably make some nicer errors?