Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-1160

Subdoc operation throws CouchbaseException instead of PathInvalidException

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • 2.4.3
    • None
    • None
    • None
    • 1

    Description

      Suggested release note:

      When a sub-document path has a syntax error or is inappropriate for an operation, the SDK now throws `PathInvalidException`. Prior to this change, it would throw a generic `CouchbaseException` with the message "Unexpected SubDocument response code".

       

      Steps to reproduce:

      collection.upsert("foo", emptyMap());
      collection.mutateIn(
          "foo",
          singletonList(MutateInSpec.insert("x[1]", "bar"))
      );
      

      Expect this to throw PathInvalidException, but actually get CouchbaseException complaining about unrecognized subdoc status code.

      Caused by: com.couchbase.client.core.error.CouchbaseException: Unexpected SubDocument response code {"completed":true,"coreId":"0xc20d295f00000001","idempotent":false,"index":0,"lastChannelId":"C20D295F00000001/000000007647928E","lastDispatchedFrom":"127.0.0.1:60950","lastDispatchedTo":"127.0.0.1:11210","path":"array[1]","requestId":105,"requestType":"SubdocMutateRequest","retried":0,"service":{"bucket":"default","collection":"_default","documentId":"SubdocAPI","errorCode":{"description":"Subdoc: Some (or all) commands failed. Inspect payload for details","name":"SUBDOC_MULTI_PATH_FAILURE"},"opaque":"0x67","scope":"_default","type":"kv","vbucket":56},"status":"SUBDOC_FAILURE","subdocStatus":"PATH_INVALID","timeoutMs":2500,"timings":{"dispatchMicros":303,"encodingMicros":20,"totalDispatchMicros":303,"totalServerMicros":0,"totalMicros":1058,"serverMicros":0}}	at com.couchbase.client.java.AsyncUtils.block(AsyncUtils.java:51)	at com.couchbase.client.java.Collection.mutateIn(Collection.java:581)	at
      .......

      Attachments

        For Gerrit Dashboard: JVMCBC-1160
        # Subject Branch Project Status CR V

        Activity

          People

            david.nault David Nault
            david.nault David Nault
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty