mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
app/vmselect: simplify code a bit after 63e0f16062
Use only a single call to prometheus.WriteErrorResponse() inside sendPrometheusError
This commit is contained in:
parent
5ad1c2b46a
commit
994b3da361
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user