Skip to content

Commit 391ae9d

Browse files
committed
loopd/daemon: handle proxy error
Check returned error to make linter happy.
1 parent 2334816 commit 391ae9d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

loopd/daemon.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,15 @@ func daemon(config *config) error {
103103
}
104104
defer restListener.Close()
105105
proxy := &http.Server{Handler: mux}
106-
go proxy.Serve(restListener)
106+
107+
go func() {
108+
err := proxy.Serve(restListener)
109+
// ErrServerClosed is always returned when the proxy is shut
110+
// down, so don't log it.
111+
if err != nil && err != http.ErrServerClosed {
112+
log.Error(err)
113+
}
114+
}()
107115

108116
statusChan := make(chan loop.SwapInfo)
109117

0 commit comments

Comments
 (0)