Skip to content

Commit

Permalink
Improved error handling for statsd dial
Browse files Browse the repository at this point in the history
  • Loading branch information
martensson committed Jul 28, 2017
1 parent cac852f commit bbe2b53
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nixy.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,13 @@ func main() {
if config.Xproxy == "" {
config.Xproxy, _ = os.Hostname()
}
statsd, _ = setupStatsd()
statsd, err = setupStatsd()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Error("unable to Dial statsd")
statsd = g2s.Noop() //fallback to Noop.
}
mux := mux.NewRouter()
mux.HandleFunc("/", nixyVersion)
mux.HandleFunc("/v1/reload", nixyReload)
Expand Down

0 comments on commit bbe2b53

Please sign in to comment.