Skip to content

Commit

Permalink
Stop app when something error happens and print them instead of log.F…
Browse files Browse the repository at this point in the history
…atal
  • Loading branch information
babarot authored and antonmedv committed Mar 26, 2019
1 parent 2cbbaaf commit 5597f3c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/gdamore/tcell"
"github.com/hokaccha/go-prettyjson"
"github.com/rivo/tview"
"log"
"os"
"time"

"github.com/gdamore/tcell"
"github.com/hokaccha/go-prettyjson"
"github.com/rivo/tview"
)

var (
Expand Down Expand Up @@ -121,7 +122,8 @@ func read() {
var value map[string]interface{}
err := dec.Decode(&value)
if err != nil {
log.Fatal(err)
log.Println(err)
app.Stop()
}

store.Lock()
Expand Down

0 comments on commit 5597f3c

Please sign in to comment.