@@ -6,7 +6,6 @@ package integration
66import (
77 "crypto/x509"
88 "crypto/x509/pkix"
9- "encoding/json"
109 "fmt"
1110 "os"
1211 "path/filepath"
@@ -15,6 +14,7 @@ import (
1514 "testing"
1615 "time"
1716
17+ "github.com/prometheus/client_golang/api/prometheus/v1"
1818 "github.com/prometheus/common/model"
1919 "github.com/prometheus/prometheus/model/labels"
2020 "github.com/prometheus/prometheus/prompb"
@@ -354,16 +354,9 @@ func runQueryFrontendTest(t *testing.T, cfg queryFrontendTestConfig) {
354354 _ , err := c .QueryRange ("up)" , start , end , time .Second )
355355 require .Error (t , err )
356356
357- // Expect the error response format to be correct.
358- type response struct {
359- Status string `json:"status"`
360- ErrorType string `json:"errorType,omitempty"`
361- Error string `json:"error,omitempty"`
362- }
363- var res response
364- err = json .Unmarshal ([]byte (err .Error ()), & res )
365- require .NoError (t , err )
366- require .Equal (t , res .ErrorType , "bad_data" )
357+ apiErr , ok := err .(v1.Error )
358+ require .True (t , ok )
359+ require .Equal (t , apiErr .Type , v1 .ErrBadData )
367360 }
368361
369362 for q := 0 ; q < numQueriesPerUser ; q ++ {
0 commit comments