472 - Don't panic if not in a repository

Display a friendly message and exit with an error if not
in a Git repository. Using the same approach used in this PR:
https://github.com/jesseduffield/lazydocker/pull/14/files
This commit is contained in:
Giorgio Previtera 2019-07-07 19:15:11 +01:00 committed by Jesse Duffield
parent 25c93c678d
commit 9fb9962ce7
5 changed files with 38 additions and 1 deletions

View file

@ -52,6 +52,9 @@ func main() {
}
if err != nil {
if errorMessage, known := app.KnownError(err); known {
log.Fatal(errorMessage)
}
newErr := errors.Wrap(err, 0)
stackTrace := newErr.ErrorStack()
app.Log.Error(stackTrace)