Skip to content

Commit

Permalink
Issue #28: use the right key
Browse files Browse the repository at this point in the history
  • Loading branch information
idrissneumann committed Nov 27, 2023
1 parent ece1f34 commit 5939acd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion pkg/quickwit/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ func (c *baseClientImpl) ExecuteMultisearch(r *MultiSearchRequest) (*MultiSearch

if res.StatusCode >= 400 {
qe := QuickwitQueryError{
Key: "msearch",
Status: res.StatusCode,
Message: "Error on multisearch",
ResponseBody: res.Body,
Expand Down
1 change: 0 additions & 1 deletion pkg/quickwit/client/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type SearchResponseHits struct {

type QuickwitQueryError struct {
Status int `json:"status"`
Key string `json:"key"`
Message string `json:"message"`
ResponseBody io.ReadCloser `json:"response_body"`
RequestBody []*SearchRequest `json:"request_body"`
Expand Down
6 changes: 3 additions & 3 deletions pkg/quickwit/data_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var newElasticsearchDataQuery = func(client es.Client, dataQuery []backend.DataQ
}
}

func handleQuickwitErrors(err error) (*backend.QueryDataResponse, error) {
func handleQuickwitErrors(e *elasticsearchDataQuery, err error) (*backend.QueryDataResponse, error) {
if nil == err {
return nil, nil
}
Expand All @@ -44,7 +44,7 @@ func handleQuickwitErrors(err error) (*backend.QueryDataResponse, error) {
Responses: backend.Responses{},
}

result.Responses[qe.Key] = backend.ErrDataResponse(backend.Status(qe.Status), payload)
result.Responses[e.dataQueries[0].RefID] = backend.ErrDataResponse(backend.Status(qe.Status), payload)
return &result, nil
}

Expand All @@ -70,7 +70,7 @@ func (e *elasticsearchDataQuery) execute() (*backend.QueryDataResponse, error) {
}

res, err := e.client.ExecuteMultisearch(req)
result, err := handleQuickwitErrors(err)
result, err := handleQuickwitErrors(e, err)
if result != nil {
return result, nil
} else if err != nil {
Expand Down

0 comments on commit 5939acd

Please sign in to comment.