Skip to content

Commit

Permalink
don't return error when parseparams fails
Browse files Browse the repository at this point in the history
I remember now that I was doing this to stop issues with grafana making extra queries that are not handled.
  • Loading branch information
tedpearson committed Jun 22, 2024
1 parent d85f725 commit 0922a40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,13 @@ func (s *Server) ServeHTTP(resp http.ResponseWriter, req *http.Request) {
}
params, err := s.ParseParams(req.Form)
if err != nil {
fmt.Printf("Failed to parse params: %s\n", err)
fmt.Printf("Failed to parse params: %s: %+v\n", err, req.Form)
resp.WriteHeader(http.StatusBadRequest)
errorJson(err, resp)
_, err = resp.Write([]byte("{}"))
if err != nil {
fmt.Printf("Error writing response to client: %+v\n", err)
}
//errorJson(err, resp)
return
}

Expand Down

0 comments on commit 0922a40

Please sign in to comment.