summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorGiorgio Previtera <gprevitera@equalexperts.com>2019-07-07 19:15:11 +0100
committerJesse Duffield <jessedduffield@gmail.com>2019-07-14 14:24:18 +1000
commit9fb9962ce7043bc3152bb0bee4a7ac17c35592d6 (patch)
tree01380da3b47b930bb89b7eb9cc4681257d0e3939 /main.go
parent25c93c678d0c198ef1610ec9d8743d8ae1e81a84 (diff)
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
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.go b/main.go
index c9959df68..7481e24d6 100644
--- a/main.go
+++ b/main.go
@@ -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)