git-gud
git-gud copied to clipboard
Develop an error logging framework to hide errors from user unless prompted
Spawned from #197 .
https://github.com/benthayer/git-gud/issues/197#issuecomment-671157907:
Hmm...just to make sure, would you like some sort of error handling so that the error is hidden from the user unless they run
git gud error
explicitly (for debug purposes)? Something like [this, maybe?]Oops! Git Gud ran into a problem. Please try your command again. If the problem persists, please run
git gud issues
to open our GitHub, and create an issue with the output ofgit gud error
so that we can try to help you!
https://github.com/benthayer/git-gud/issues/197#issuecomment-671614510:
I don't think we need to
pickle
the error, since the stack trace is only useful as text for us (and so,pickle
seems overkill). We could always just output to two files,.git/gud/error.txt
and.git/gud/logs/hh:mm-DDMMYY.txt
witherror.txt
holding the content of the most recent log.git gud error
would print outerror.txt
.I think we should try to make use of the
logging
module, since it has support for writing to files with extra information.
In terms of logging, do you think we should say An unknown error occured. Please run git gud error for more details. If the problem persists, please post the error message from using "git gud issues"
I'm fine with whatever error message, as long as it (tells the user to (1) run git gud error
for details, and (2) to submit an issue to GitHub with the content of git gud error
using git gud issues
.