From fb67d368a218d7279fe63d791f48a33e88113ad7 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Tue, 11 Apr 2023 13:45:34 -0700 Subject: [PATCH] use consistent error for instant and range query 400 Signed-off-by: Ben Ye --- web/api/v1/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/api/v1/api.go b/web/api/v1/api.go index 3b6ade562..a210e0001 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -522,7 +522,7 @@ func (api *API) queryRange(r *http.Request) (result apiFuncResult) { } qry, err := api.QueryEngine.NewRangeQuery(api.Queryable, opts, r.FormValue("query"), start, end, step) if err != nil { - return apiFuncResult{nil, &apiError{errorBadData, err}, nil, nil} + return invalidParamError(err, "query") } // From now on, we must only return with a finalizer in the result (to // be called by the caller) or call qry.Close ourselves (which is