Skip to content

Commit

Permalink
return serve measure error
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxkad committed Feb 11, 2024
1 parent ba075e0 commit 24d0208
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,10 @@ func (cr *Cluster) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
http.Error(rw, fmt.Sprintf("measure size %d out of range (0, 200]", n), http.StatusBadRequest)
return
}
cr.storages[0].ServeMeasure(rw, req, n)
if err := cr.storages[0].ServeMeasure(rw, req, n); err != nil {
logErrorf("Could not serve measure %d: %v", n, err)
http.Error(rw, err.Error(), http.StatusInternalServerError)
}
return
case strings.HasPrefix(rawpath, "/api/"):
version, _ := split(rawpath[len("/api/"):], '/')
Expand Down

0 comments on commit 24d0208

Please sign in to comment.