In certain cases, couchbase server views can return a 200 response code with partial errors embedded. See this ngrep capture for example HTTP traffic.
Based on looking at the GoCB code, I'm seeing a mismatch in field names related to partial errors:
- In this ngrep capture, the field name is "errors"
- The gocb code in bucket_viewquery.go is looking for a field called "error" (singular vs plural)
Depending on the outcome of the discussion in MB-25068 (see comment about handling failure cases), it might also be useful to add the ability of the caller to get at these partial errors.
In the Sync Gateway case, since we are essentially proxying view query results back to a client that is calling the SG Views API, we just need a way to propagate these errors back. At the moment, it doesn't look like GoCB is exposing the errors that can come back from Couchbase Server in the "errors" field of the view query response.
Gocb commit: 0cd63ba8b594091ea0005ec50ee21299e0b22d97
Gocb core commit:
|For Gerrit Dashboard: GOCBC-224|
|82063,3||GOCBC-224: Return partial view errors during Close call.||master||gocb||Status: MERGED||+2||+1|