benthayer / git-gud

Wanna git gud? Then get git-gud, and git gud at git!
MIT License
401 stars 42 forks source link

Develop an error logging framework to hide errors from user unless prompted #279

Open sahansk2 opened 3 years ago

sahansk2 commented 3 years ago

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 of git 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 with error.txt holding the content of the most recent log. git gud error would print out error.txt.

I think we should try to make use of the logging module, since it has support for writing to files with extra information.

benthayer commented 3 years ago

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"

sahansk2 commented 3 years ago

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.