loopd/daemon: handle proxy error

Check returned error to make linter happy.
pull/115/head
Johan T. Halseth 4 years ago
parent 2334816a59
commit 391ae9dc6b
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -103,7 +103,15 @@ func daemon(config *config) error {
}
defer restListener.Close()
proxy := &http.Server{Handler: mux}
go proxy.Serve(restListener)
go func() {
err := proxy.Serve(restListener)
// ErrServerClosed is always returned when the proxy is shut
// down, so don't log it.
if err != nil && err != http.ErrServerClosed {
log.Error(err)
}
}()
statusChan := make(chan loop.SwapInfo)

Loading…
Cancel
Save