app/vmselect: simplify code a bit after 63e0f16062

Use only a single call to prometheus.WriteErrorResponse() inside sendPrometheusError
This commit is contained in:
Aliaksandr Valialkin 2023-11-16 18:14:22 +01:00
parent 84b3c1d3bc
commit aae06e003e
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -561,8 +561,7 @@ func sendPrometheusError(w http.ResponseWriter, r *http.Request, err error) {
var ure *promql.UserReadableError
if errors.As(err, &ure) {
prometheus.WriteErrorResponse(w, statusCode, ure)
return
err = ure
}
prometheus.WriteErrorResponse(w, statusCode, err)
}