log error
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Evan Reichard 2025-09-22 23:09:41 -04:00
parent 2e73689762
commit de23b3e815

View File

@ -73,7 +73,7 @@ func (s *Server) Start() error {
for { for {
conn, err := listener.Accept() conn, err := listener.Accept()
if err != nil { if err != nil {
log.Printf("error accepting connection: %v", err) log.WithError(err).Error("error accepting connection")
continue continue
} }
@ -99,12 +99,14 @@ func (s *Server) getInfo(w http.ResponseWriter, _ *http.Request) {
Version: config.GetVersion(), Version: config.GetVersion(),
}, "", " ") }, "", " ")
if err != nil { if err != nil {
log.WithError(err).Error("failed to marshal info")
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusInternalServerError)
return return
} }
// Send Response // Send Response
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
_, _ = w.Write(d) _, _ = w.Write(d)
} }