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 5ad1c2b46a
commit 994b3da361
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

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