diff --git a/apierr/error_mapping.go b/apierr/error_mapping.go index 6ebcf8d9e..f12c48dff 100755 --- a/apierr/error_mapping.go +++ b/apierr/error_mapping.go @@ -19,6 +19,7 @@ var ( ErrTemporarilyUnavailable = errors.New("the service is currently unavailable") ErrDeadlineExceeded = errors.New("the deadline expired before the operation could complete") ErrInvalidParameterValue = inheritErr(ErrBadRequest, "supplied value for a parameter was invalid") + ErrFeatureDisabled = inheritErr(ErrNotFound, "feature is disabled for the current workspace") ErrResourceDoesNotExist = inheritErr(ErrNotFound, "operation was performed on a resource that does not exist") ErrAborted = inheritErr(ErrResourceConflict, "the operation was aborted, typically due to a concurrency issue such as a sequencer check failure") ErrAlreadyExists = inheritErr(ErrResourceConflict, "operation was rejected due a conflict with an existing resource") @@ -44,6 +45,7 @@ var ( errorCodeMapping = map[string]error{ "INVALID_PARAMETER_VALUE": ErrInvalidParameterValue, + "FEATURE_DISABLED": ErrFeatureDisabled, "RESOURCE_DOES_NOT_EXIST": ErrResourceDoesNotExist, "ABORTED": ErrAborted, "ALREADY_EXISTS": ErrAlreadyExists, diff --git a/error_alias.go b/error_alias.go index d4165bd0e..bfaa8885f 100755 --- a/error_alias.go +++ b/error_alias.go @@ -29,6 +29,8 @@ var ( ErrDeadlineExceeded = apierr.ErrDeadlineExceeded // supplied value for a parameter was invalid ErrInvalidParameterValue = apierr.ErrInvalidParameterValue + // feature is disabled for the current workspace + ErrFeatureDisabled = apierr.ErrFeatureDisabled // operation was performed on a resource that does not exist ErrResourceDoesNotExist = apierr.ErrResourceDoesNotExist // the operation was aborted, typically due to a concurrency issue such as a sequencer check failure diff --git a/openapi/errors.go b/openapi/errors.go index 4f4635e48..8bc748182 100644 --- a/openapi/errors.go +++ b/openapi/errors.go @@ -22,6 +22,7 @@ var ErrorStatusCodeMapping = []ErrorMappingRule{ var ErrorCodeMapping = []ErrorMappingRule{ {400, "INVALID_PARAMETER_VALUE", "supplied value for a parameter was invalid"}, + {404, "FEATURE_DISABLED", "feature is disabled for the current workspace"}, {404, "RESOURCE_DOES_NOT_EXIST", "operation was performed on a resource that does not exist"}, {409, "ABORTED", "the operation was aborted, typically due to a concurrency issue such as a sequencer check failure"}, {409, "ALREADY_EXISTS", "operation was rejected due a conflict with an existing resource"},