Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-1792

createCollection throws generic CouchbaseException instead of ScopeNotFoundException 

    XMLWordPrintable

Details

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

    Description

      With this sample code:

      try {
              CollectionSpec spec = CollectionSpec.create("example-collection", "nonexistent-scope");
              collectionMgr.createCollection(spec);
      }
      catch (CollectionExistsException e) {
              System.out.println("Collection already exists");
      }
      catch (ScopeNotFoundException e) {
              System.out.println("The specified parent scope doesn't exist");      }
      catch (Exception e) {
              System.out.println(e);
      }

      I'd expect a ScopeNotFoundException as per the API docs but get

      com.couchbase.client.core.error.CouchbaseException: Unknown error in CollectionManager: {"errors":{"_":"Scope with name \"nonexistent-scope\" is not found"}}, response: GenericManagerResponse{status=NOT_FOUND, httpStatus=404, content={"errors":{"_":"Scope with name \"nonexistent-scope\" is not found"}}} 

       NB: similar generic errors are found with dropCollection and dropScope for both expected ScopeNotFoundException and CollectionNotFoundException

      Attachments

        Issue Links

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

          Activity

            People

              david.nault David Nault
              hakim.cassimally Hakim Cassimally
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty