Fix missing err != nil branch

This commit is contained in:
David Dworken 2023-09-17 13:07:38 -07:00
parent d94e1bfa22
commit 1ab61f1d7d
No known key found for this signature in database

View File

@ -338,10 +338,12 @@ func (s *Server) getNumConnectionsHandler(w http.ResponseWriter, r *http.Request
}
func (s *Server) handleNonCriticalError(err error) {
if s.isProductionEnvironment {
fmt.Printf("Unexpected non-critical error: %v", err)
} else {
panic(fmt.Errorf("unexpected non-critical error: %w", err))
if err != nil {
if s.isProductionEnvironment {
fmt.Printf("Unexpected non-critical error: %v", err)
} else {
panic(fmt.Errorf("unexpected non-critical error: %w", err))
}
}
}