Skip to content

Commit

Permalink
Log ListenAndServe errors
Browse files Browse the repository at this point in the history
logging to detect issues such as "bind: address already in use".
  • Loading branch information
matsuu authored and Zxilly committed Sep 1, 2024
1 parent ea0782e commit 5be8ec4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/webui/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package webui

import (
"io"
"log/slog"
"net/http"
"time"
)
Expand All @@ -20,7 +21,7 @@ func HostServer(content []byte, listen string) io.Closer {
}
server.SetKeepAlivesEnabled(false)
go func() {
_ = server.ListenAndServe()
slog.Error(server.ListenAndServe().Error())
}()
return server
}

0 comments on commit 5be8ec4

Please sign in to comment.