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