Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-858

dropScope and dropCollection raise FeatureNotAvailableError instead of the expected {Scope|Collection}NotFoundError

    XMLWordPrintable

Details

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

    Description

      when I await cmgr.dropScope("nonexistent-scope") I’m getting a FeatureNotAvailableError instead of the expected ScopeNotFoundError
       
      Brett Lawson says "Good catch.  Definitely a bug. I think I just need to invert the operations there.  Detecting the explicit not-found before the feature-not-available."

              if (
                errText.includes('not allowed on this version of cluster') ||
                res.statusCode === 404
              ) {
                throw new FeatureNotAvailableError(undefined, errCtx)
              }
              if (errText.includes('not found') && errText.includes('scope')) {
                throw new ScopeNotFoundError(undefined, errCtx)
              }

       

       
      The same issue applies with

      await collectionMgr.dropCollection("nonexistent-collection", "example-scope");

      Also note that https://github.com/couchbase/couchnode/blob/faa22141b3f24150190f50aab80dc46671d6a16c/test/collectionmanager.test.js seems to test for this, so may be worth double checking if it's run correctly.
       

      Attachments

        Issue Links

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

          Activity

            People

              brett19 Brett Lawson
              hakim.cassimally Hakim Cassimally
              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