Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1374

Support Invalid user input classes for errors

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.1.0
    • None
    • None
    • 1

    Description

      As initiated in CCBC-1308 Support FATAL and TRANSIENT classes for errors, this request aim at creating a new class for invalid user input error.  Also to define corresponding macros for easy access.

      Attachments

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

        Activity

          Alexis Deltour Alexis Deltour added a comment - - edited

          list of invalidinput error implemented in Amadeus client:

           
           

          bool ErrorManager::IsLcbErrTypeInput(lcb_STATUS iLcbError) {     /* INPUT error type (LCB_EIFINPUT method does not exist anymore in 3.0.6)         2.10.5                          3.0.6                               kvclient exceptions                  LCB_AUTH_ERROR                  LCB_ERR_AUTHENTICATION_FAILURE      kKVClientError_AuthenticationError         LCB_DELTA_BADVAL                LCB_ERR_INVALID_DELTA               kKVClientError_InvalidUserInput          LCB_E2BIG                       LCB_ERR_VALUE_TOO_LARGE             kKVClientError_InvalidUserInput                                         LCB_ERR_DURABILITY_LEVEL_NOT_AVAILABLE kKVClientError_InvalidUserInput                                         LCB_ERR_DURABILITY_IMPOSSIBLE       kKVClientError_InvalidUserInput                                         LCB_ERR_DURABILITY_AMBIGUOUS        kKVClientError_InvalidUserInput         LCB_EINVAL                      LCB_ERR_INVALID_ARGUMENT            kKVClientError_UnknownError          LCB_ERANGE                      LCB_ERR_INVALID_RANGE               kKVClientError_InvalidUserInput         LCB_DLOPEN_FAILED               LCB_ERR_DLOPEN_FAILED               kKVClientError_UnknownError          LCB_DLSYM_FAILED                LCB_ERR_DLSYM_FAILED                kKVClientError_UnknownError          LCB_UNKNOWN_HOST                LCB_ERR_UNKNOWN_HOST                kKVClientError_ConnectionError         LCB_BUCKET_ENOENT               LCB_ERR_BUCKET_NOT_FOUND            kKVClientError_ConnectionError         LCB_EBADHANDLE                           LCB_PLUGIN_VERSION_MISMATCH     LCB_ERR_PLUGIN_VERSION_MISMATCH     kKVClientError_ClientEnvError         LCB_INVALID_HOST_FORMAT         LCB_ERR_INVALID_HOST_FORMAT         kKVClientError_ConnectionError         LCB_INVALID_CHAR                LCB_ERR_INVALID_CHAR                kKVClientError_ClientEnvError         LCB_DURABILITY_ETOOMANY         LCB_ERR_DURABILITY_TOO_MANY         kKVClientError_InvalidUserInput         LCB_DUPLICATE_COMMANDS          LCB_ERR_DUPLICATE_COMMANDS          kKVClientError_InvalidUserInput         LCB_BAD_ENVIRONMENT             LCB_ERR_BAD_ENVIRONMENT             kKVClientError_ClientConfigurationError         LCB_INVALID_USERNAME                     LCB_CONFIG_CACHE_INVALID        LCB_ERR_CONFIG_CACHE_INVALID         LCB_SASLMECH_UNAVAILABLE        LCB_ERR_SASLMECH_UNAVAILABLE        kKVClientError_AuthenticationError         LCB_INCOMPLETE_PACKET           LCB_ERR_INCOMPLETE_PACKET                    LCB_ECTL_UNKNOWN                LCB_ERR_CONTROL_UNKNOWN_CODE                 LCB_ECTL_UNSUPPMODE             LCB_ERR_CONTROL_UNSUPPORTED_MODE             LCB_ECTL_BADARG                 LCB_ERR_CONTROL_INVALID_ARGUMENT             LCB_EMPTY_KEY                   LCB_ERR_EMPTY_KEY                   kKVClientError_InvalidUserInput         LCB_CLIENT_FEATURE_UNAVAILABLE  LCB_ERR_SDK_FEATURE_UNAVAILABLE     kKVClientError_ClientConfigurationError         LCB_OPTIONS_CONFLICT            LCB_ERR_OPTIONS_CONFLICT            kKVClientError_InvalidUserInput         LCB_DURABILITY_NO_MUTATION_TOKENS LCB_ERR_DURABILITY_NO_MUTATION_TOKENS kKVClientError_ServerEnvError         LCB_SUBDOC_PATH_EINVAL          LCB_ERR_SUBDOC_PATH_INVALID         kKVClientError_UnknownError          LCB_SUBDOC_PATH_E2BIG           LCB_ERR_SUBDOC_PATH_TOO_BIG         kKVClientError_UnknownError          LCB_SUBDOC_VALUE_CANTINSERT     LCB_ERR_SUBDOC_VALUE_INVALID        kKVClientError_UnknownError          LCB_SUBDOC_VALUE_E2DEEP         LCB_ERR_SUBDOC_VALUE_TOO_DEEP       kKVClientError_UnknownError          LCB_EMPTY_PATH                  LCB_ERR_SUBDOC_PATH_INVALID         kKVClientError_UnknownError          LCB_UNKNOWN_SDCMD               LCB_ERR_UNKNOWN_SUBDOC_COMMAND      kKVClientError_UnknownError          LCB_ENO_COMMANDS                LCB_ERR_NO_COMMANDS         LCB_GENERIC_CONSTRAINT_ERR      LCB_ERR_CAS_MISMATCH                kKVClientError_ServerTmpFailure         LCB_NOT_AUTHORIZED              LCB_ERR_NOT_AUTHORIZED              kKVClientError_PermissionError         LCB_SUBDOC_INVALID_COMBO        LCB_ERR_INVALID_ARGUMENT            kKVClientError_InvalidUserInput         LCB_SUBDOC_MULTI_PATH_FAILURE            LCB_SUBDOC_SUCCESS_DELETED               LCB_SUBDOC_XATTR_INVALID_FLAG_COMBO LCB_ERR_SUBDOC_XATTR_INVALID_FLAG_COMBO         LCB_SUBDOC_XATTR_INVALID_KEY_COMBO LCB_ERR_SUBDOC_XATTR_INVALID_KEY_COMBO         LCB_SUBDOC_XATTR_UNKNOWN_MACRO  LCB_ERR_SUBDOC_XATTR_UNKNOWN_MACRO         LCB_SUBDOC_XATTR_UNKNOWN_VATTR  LCB_ERR_SUBDOC_XATTR_UNKNOWN_VIRTUAL_ATTRIBUTE         LCB_SUBDOC_XATTR_CANT_MODIFY_VATTR LCB_ERR_SUBDOC_XATTR_CANNOT_MODIFY_VIRTUAL_ATTRIBUTE         LCB_SUBDOC_MULTI_PATH_FAILURE_DELETED          LCB_SUBDOC_INVALID_XATTR_ORDER  LCB_ERR_SUBDOC_XATTR_INVALID_ORDER     */     switch(iLcbError)     {     case LCB_ERR_AUTHENTICATION_FAILURE:     case LCB_ERR_INVALID_DELTA:     case LCB_ERR_VALUE_TOO_LARGE:     case LCB_ERR_DURABILITY_LEVEL_NOT_AVAILABLE:     case LCB_ERR_DURABILITY_IMPOSSIBLE:     case LCB_ERR_DURABILITY_AMBIGUOUS:     case LCB_ERR_INVALID_ARGUMENT:     case LCB_ERR_INVALID_RANGE:     case LCB_ERR_DLOPEN_FAILED:     case LCB_ERR_DLSYM_FAILED:     case LCB_ERR_UNKNOWN_HOST:     case LCB_ERR_BUCKET_NOT_FOUND:     case LCB_ERR_PLUGIN_VERSION_MISMATCH:     case LCB_ERR_INVALID_HOST_FORMAT:     case LCB_ERR_INVALID_CHAR:     case LCB_ERR_DURABILITY_TOO_MANY:     case LCB_ERR_DUPLICATE_COMMANDS:     case LCB_ERR_BAD_ENVIRONMENT:     case LCB_ERR_CONFIG_CACHE_INVALID:     case LCB_ERR_SASLMECH_UNAVAILABLE:     case LCB_ERR_INCOMPLETE_PACKET:     case LCB_ERR_CONTROL_UNKNOWN_CODE:     case LCB_ERR_CONTROL_UNSUPPORTED_MODE:     case LCB_ERR_CONTROL_INVALID_ARGUMENT:     case LCB_ERR_EMPTY_KEY:     case LCB_ERR_SDK_FEATURE_UNAVAILABLE:     case LCB_ERR_OPTIONS_CONFLICT:     case LCB_ERR_DURABILITY_NO_MUTATION_TOKENS:     case LCB_ERR_NO_COMMANDS:     case LCB_ERR_CAS_MISMATCH:     // subdoc     case LCB_ERR_SUBDOC_PATH_INVALID:     case LCB_ERR_SUBDOC_PATH_TOO_BIG:     case LCB_ERR_SUBDOC_VALUE_INVALID:     case LCB_ERR_SUBDOC_VALUE_TOO_DEEP:     case LCB_ERR_UNKNOWN_SUBDOC_COMMAND:     // xattr subdoc     case LCB_ERR_SUBDOC_XATTR_INVALID_FLAG_COMBO:     case LCB_ERR_SUBDOC_XATTR_INVALID_KEY_COMBO:     case LCB_ERR_SUBDOC_XATTR_UNKNOWN_MACRO:     case LCB_ERR_SUBDOC_XATTR_UNKNOWN_VIRTUAL_ATTRIBUTE:     case LCB_ERR_SUBDOC_XATTR_CANNOT_MODIFY_VIRTUAL_ATTRIBUTE:     case LCB_ERR_SUBDOC_XATTR_INVALID_ORDER:         return true;     default:         return false;     } }

           

          Alexis Deltour Alexis Deltour added a comment - - edited list of invalidinput error implemented in Amadeus client:     bool ErrorManager::IsLcbErrTypeInput(lcb_STATUS iLcbError) {      /* INPUT error type (LCB_EIFINPUT method does not exist anymore in 3.0.6)         2.10.5                          3.0.6                               kvclient exceptions                  LCB_AUTH_ERROR                  LCB_ERR_AUTHENTICATION_FAILURE      kKVClientError_AuthenticationError         LCB_DELTA_BADVAL                LCB_ERR_INVALID_DELTA               kKVClientError_InvalidUserInput          LCB_E2BIG                       LCB_ERR_VALUE_TOO_LARGE             kKVClientError_InvalidUserInput                                         LCB_ERR_DURABILITY_LEVEL_NOT_AVAILABLE kKVClientError_InvalidUserInput                                         LCB_ERR_DURABILITY_IMPOSSIBLE       kKVClientError_InvalidUserInput                                         LCB_ERR_DURABILITY_AMBIGUOUS        kKVClientError_InvalidUserInput         LCB_EINVAL                      LCB_ERR_INVALID_ARGUMENT            kKVClientError_UnknownError          LCB_ERANGE                      LCB_ERR_INVALID_RANGE               kKVClientError_InvalidUserInput         LCB_DLOPEN_FAILED               LCB_ERR_DLOPEN_FAILED               kKVClientError_UnknownError          LCB_DLSYM_FAILED                LCB_ERR_DLSYM_FAILED                kKVClientError_UnknownError          LCB_UNKNOWN_HOST                LCB_ERR_UNKNOWN_HOST                kKVClientError_ConnectionError         LCB_BUCKET_ENOENT               LCB_ERR_BUCKET_NOT_FOUND            kKVClientError_ConnectionError         LCB_EBADHANDLE                           LCB_PLUGIN_VERSION_MISMATCH     LCB_ERR_PLUGIN_VERSION_MISMATCH     kKVClientError_ClientEnvError         LCB_INVALID_HOST_FORMAT         LCB_ERR_INVALID_HOST_FORMAT         kKVClientError_ConnectionError         LCB_INVALID_CHAR                LCB_ERR_INVALID_CHAR                kKVClientError_ClientEnvError         LCB_DURABILITY_ETOOMANY         LCB_ERR_DURABILITY_TOO_MANY         kKVClientError_InvalidUserInput         LCB_DUPLICATE_COMMANDS          LCB_ERR_DUPLICATE_COMMANDS          kKVClientError_InvalidUserInput         LCB_BAD_ENVIRONMENT             LCB_ERR_BAD_ENVIRONMENT             kKVClientError_ClientConfigurationError         LCB_INVALID_USERNAME                     LCB_CONFIG_CACHE_INVALID        LCB_ERR_CONFIG_CACHE_INVALID         LCB_SASLMECH_UNAVAILABLE        LCB_ERR_SASLMECH_UNAVAILABLE        kKVClientError_AuthenticationError         LCB_INCOMPLETE_PACKET           LCB_ERR_INCOMPLETE_PACKET                    LCB_ECTL_UNKNOWN                LCB_ERR_CONTROL_UNKNOWN_CODE                 LCB_ECTL_UNSUPPMODE             LCB_ERR_CONTROL_UNSUPPORTED_MODE             LCB_ECTL_BADARG                 LCB_ERR_CONTROL_INVALID_ARGUMENT             LCB_EMPTY_KEY                   LCB_ERR_EMPTY_KEY                   kKVClientError_InvalidUserInput         LCB_CLIENT_FEATURE_UNAVAILABLE  LCB_ERR_SDK_FEATURE_UNAVAILABLE     kKVClientError_ClientConfigurationError         LCB_OPTIONS_CONFLICT            LCB_ERR_OPTIONS_CONFLICT            kKVClientError_InvalidUserInput         LCB_DURABILITY_NO_MUTATION_TOKENS LCB_ERR_DURABILITY_NO_MUTATION_TOKENS kKVClientError_ServerEnvError         LCB_SUBDOC_PATH_EINVAL          LCB_ERR_SUBDOC_PATH_INVALID         kKVClientError_UnknownError          LCB_SUBDOC_PATH_E2BIG           LCB_ERR_SUBDOC_PATH_TOO_BIG         kKVClientError_UnknownError          LCB_SUBDOC_VALUE_CANTINSERT     LCB_ERR_SUBDOC_VALUE_INVALID        kKVClientError_UnknownError          LCB_SUBDOC_VALUE_E2DEEP         LCB_ERR_SUBDOC_VALUE_TOO_DEEP       kKVClientError_UnknownError          LCB_EMPTY_PATH                  LCB_ERR_SUBDOC_PATH_INVALID         kKVClientError_UnknownError          LCB_UNKNOWN_SDCMD               LCB_ERR_UNKNOWN_SUBDOC_COMMAND      kKVClientError_UnknownError          LCB_ENO_COMMANDS                LCB_ERR_NO_COMMANDS         LCB_GENERIC_CONSTRAINT_ERR      LCB_ERR_CAS_MISMATCH                kKVClientError_ServerTmpFailure         LCB_NOT_AUTHORIZED              LCB_ERR_NOT_AUTHORIZED              kKVClientError_PermissionError         LCB_SUBDOC_INVALID_COMBO        LCB_ERR_INVALID_ARGUMENT            kKVClientError_InvalidUserInput         LCB_SUBDOC_MULTI_PATH_FAILURE            LCB_SUBDOC_SUCCESS_DELETED               LCB_SUBDOC_XATTR_INVALID_FLAG_COMBO LCB_ERR_SUBDOC_XATTR_INVALID_FLAG_COMBO         LCB_SUBDOC_XATTR_INVALID_KEY_COMBO LCB_ERR_SUBDOC_XATTR_INVALID_KEY_COMBO         LCB_SUBDOC_XATTR_UNKNOWN_MACRO  LCB_ERR_SUBDOC_XATTR_UNKNOWN_MACRO         LCB_SUBDOC_XATTR_UNKNOWN_VATTR  LCB_ERR_SUBDOC_XATTR_UNKNOWN_VIRTUAL_ATTRIBUTE         LCB_SUBDOC_XATTR_CANT_MODIFY_VATTR LCB_ERR_SUBDOC_XATTR_CANNOT_MODIFY_VIRTUAL_ATTRIBUTE         LCB_SUBDOC_MULTI_PATH_FAILURE_DELETED          LCB_SUBDOC_INVALID_XATTR_ORDER  LCB_ERR_SUBDOC_XATTR_INVALID_ORDER     */      switch (iLcbError)     {      case  LCB_ERR_AUTHENTICATION_FAILURE:      case  LCB_ERR_INVALID_DELTA:      case  LCB_ERR_VALUE_TOO_LARGE:      case  LCB_ERR_DURABILITY_LEVEL_NOT_AVAILABLE:      case  LCB_ERR_DURABILITY_IMPOSSIBLE:      case  LCB_ERR_DURABILITY_AMBIGUOUS:      case  LCB_ERR_INVALID_ARGUMENT:      case  LCB_ERR_INVALID_RANGE:      case  LCB_ERR_DLOPEN_FAILED:      case  LCB_ERR_DLSYM_FAILED:      case  LCB_ERR_UNKNOWN_HOST:      case  LCB_ERR_BUCKET_NOT_FOUND:      case  LCB_ERR_PLUGIN_VERSION_MISMATCH:      case  LCB_ERR_INVALID_HOST_FORMAT:      case  LCB_ERR_INVALID_CHAR:      case  LCB_ERR_DURABILITY_TOO_MANY:      case  LCB_ERR_DUPLICATE_COMMANDS:      case  LCB_ERR_BAD_ENVIRONMENT:      case  LCB_ERR_CONFIG_CACHE_INVALID:      case  LCB_ERR_SASLMECH_UNAVAILABLE:      case  LCB_ERR_INCOMPLETE_PACKET:      case  LCB_ERR_CONTROL_UNKNOWN_CODE:      case  LCB_ERR_CONTROL_UNSUPPORTED_MODE:      case  LCB_ERR_CONTROL_INVALID_ARGUMENT:      case  LCB_ERR_EMPTY_KEY:      case  LCB_ERR_SDK_FEATURE_UNAVAILABLE:      case  LCB_ERR_OPTIONS_CONFLICT:      case  LCB_ERR_DURABILITY_NO_MUTATION_TOKENS:      case  LCB_ERR_NO_COMMANDS:      case  LCB_ERR_CAS_MISMATCH:      // subdoc     case LCB_ERR_SUBDOC_PATH_INVALID:     case LCB_ERR_SUBDOC_PATH_TOO_BIG:     case LCB_ERR_SUBDOC_VALUE_INVALID:     case LCB_ERR_SUBDOC_VALUE_TOO_DEEP:     case LCB_ERR_UNKNOWN_SUBDOC_COMMAND:     // xattr subdoc     case LCB_ERR_SUBDOC_XATTR_INVALID_FLAG_COMBO:     case LCB_ERR_SUBDOC_XATTR_INVALID_KEY_COMBO:     case LCB_ERR_SUBDOC_XATTR_UNKNOWN_MACRO:     case LCB_ERR_SUBDOC_XATTR_UNKNOWN_VIRTUAL_ATTRIBUTE:     case LCB_ERR_SUBDOC_XATTR_CANNOT_MODIFY_VIRTUAL_ATTRIBUTE:     case LCB_ERR_SUBDOC_XATTR_INVALID_ORDER:         return true;     default:         return false;     } }  

          Build couchbase-server-7.0.0-5043 contains libcouchbase commit c76cdb4 with commit message:
          CCBC-1374: reintroduce input error classification macro

          build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.0-5043 contains libcouchbase commit c76cdb4 with commit message: CCBC-1374 : reintroduce input error classification macro

          People

            avsej Sergey Avseyev
            Alexis Deltour Alexis Deltour
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty