From 116ce1a806ca60aa50fbc1592b2118ab351d6b4d Mon Sep 17 00:00:00 2001 From: Quentin Machu Date: Mon, 1 Feb 2016 18:51:13 -0500 Subject: [PATCH] api: fix log message when stopping the API server --- api/api.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/api.go b/api/api.go index 25f94eee..9528fe72 100644 --- a/api/api.go +++ b/api/api.go @@ -109,8 +109,10 @@ func listenAndServeWithStopper(srv *graceful.Server, st *utils.Stopper, certFile err = srv.ListenAndServe() } - if opErr, ok := err.(*net.OpError); !ok || (ok && opErr.Op != "accept") { - log.Fatal(err) + if err != nil { + if opErr, ok := err.(*net.OpError); !ok || (ok && opErr.Op != "accept") { + log.Fatal(err) + } } }