Open brianfeister opened 2 weeks ago
Something along these lines:
var errMsg string // properly type me!
resp, err := c.reqClient.
R().
SetQueryParams(queryParams).
SetBody(searchReq).
SetErrorResult(&errMsg).
EnableDump().
SetSuccessResult(&searchResp).
Post(c.reqClient.BaseURL + "/indexes/" + searchReq.IndexName + "/search")
@brianfeister Thanks for pointing it out. I guess its good for debugging for sure. I think the only case where we need to set is if the log level is debug? WDYT?
Right now this library just says
error searching
if marqo sends an error, which makes it very difficult to debug an incorrect request body. It would be great if we sent back the marqo response body for debugging purposes!I can put up a PR for this when I'm a bit less busy (cc @msnorth ) but the way the imroc/req pkg only sends back
400
and not the actual body content from marqo is a real challenge for debuggingAt this line https://github.com/ganeshdipdumbare/marqo-go/blob/main/search.go#L263 we could use
.EnableReqDump()
from the Imroc req pkg docs: https://github.com/imroc/req?tab=readme-ov-file#advanced-get