Uploaded image for project: 'Couchbase Go SDK'
  1. Couchbase Go SDK
  2. GOCBC-341

When server returns unexpected error with a string, gocb.ExecuteSearchQuery returns json unmarshal error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.4.1
    • None
    • None
    • None
    • 1

    Description

      with gocb 1.4, gocbcore v7,
      When fts query server returns error like this

      search request rejected","request":{"ctl":

      {"consistency":null,"timeout":9499}

      ,"explain":true,"facets":null,"fields":["*"],"from":0,"highlight":

      {"fields":null,"style":null}

      ,"includeLocations":false,"pindexNames":["ftsIndex_6dc7bf54169cbbda_f4e0a48a","ftsIndex_6dc7bf54169cbbda_18572d87"],"query":

      {"query":"SampleValue1"}

      ,"size":10,"sort":["-_score"]},"status":"fail"}

      gocb.ExecuteSearchQuery returns "json: cannot unmarshal string into Go struct field searchResponse.status of type gocb.SearchResultStatus"

      Expected: Go SDK needs to handle the case where server response can not be parsed as searchResponse.status rather than returning unmarshal error. maybe Go sdk needs to check why the server error is considered as string type.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            charles.dixon Charles Dixon
            jaekwon.park Jae Park [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty