Skip to content

Commit ecb52ac

Browse files
committed
Issue #22: add log when quickwit return an error
1 parent fad95cb commit ecb52ac

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

build_and_start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
npm install
44
npm run build
55
mage -v
6+
go test -v ./pkg/...
67
docker-compose up --build --force-recreate

pkg/quickwit/client/client.go

+7
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ func (c *baseClientImpl) ExecuteMultisearch(r *MultiSearchRequest) (*MultiSearch
166166

167167
c.logger.Debug("Received multisearch response", "code", res.StatusCode, "status", res.Status, "content-length", res.ContentLength)
168168

169+
if res.StatusCode >= 400 {
170+
jsonResponseBody, _ := json.Marshal(res.Body)
171+
jsonQueryParam, _ := json.Marshal(queryParams)
172+
jsonRequestBody, _ := json.Marshal(r.Requests)
173+
c.logger.Error("Error on multisearch: statusCode = " + strconv.Itoa(res.StatusCode) + ", responseBody = " + string(jsonResponseBody) + ", queryParam = " + string(jsonQueryParam) + ", requestBody = " + string(jsonRequestBody))
174+
}
175+
169176
start := time.Now()
170177
c.logger.Debug("Decoding multisearch json response")
171178

0 commit comments

Comments
 (0)