Skip to content

Commit

Permalink
feat: Print errors with %s if ShowStackTraces = false (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
cszatmary authored Mar 30, 2020
1 parent fe9d962 commit 1f6f561
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fatal/fatal.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func ExitErr(err error, message string) {

if ShowStackTraces {
fmt.Fprintf(os.Stderr, "Error: %+v\n", err)
} else {
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
}

os.Exit(1)
Expand All @@ -23,6 +25,8 @@ func ExitErrf(err error, format string, a ...interface{}) {

if ShowStackTraces {
fmt.Fprintf(os.Stderr, "Error: %+v\n", err)
} else {
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
}

os.Exit(1)
Expand Down

0 comments on commit 1f6f561

Please sign in to comment.