Skip to content

Commit 380db50

Browse files
authored
Merge pull request #8668 from aspandey/object-quota-issue
Noobaa/Quota: Provide correct error message
2 parents c1549a1 + dd93e63 commit 380db50

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/endpoint/s3/s3_errors.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ S3Error.InvalidBucketState = Object.freeze({
164164
message: 'The request is not valid with the current state of the bucket.',
165165
http_code: 409,
166166
});
167+
S3Error.ObjectQuotaExceeded = Object.freeze({
168+
code: 'ObjectQuotaExceeded',
169+
message: 'Object quota exceeded for the bucket.',
170+
http_code: 409,
171+
});
167172
S3Error.InvalidDigest = Object.freeze({
168173
code: 'InvalidDigest',
169174
message: 'The Content-MD5 you specified is not valid.',
@@ -613,6 +618,7 @@ S3Error.RPC_ERRORS_TO_S3 = Object.freeze({
613618
INVALID_PORT_ORDER: S3Error.InvalidPartOrder,
614619
INVALID_BUCKET_STATE: S3Error.InvalidBucketState,
615620
NOT_ENOUGH_SPACE: S3Error.InvalidBucketState,
621+
OBJECT_QUOTA_EXCEEDED: S3Error.ObjectQuotaExceeded,
616622
MALFORMED_POLICY: S3Error.MalformedPolicy,
617623
NO_SUCH_OBJECT_LOCK_CONFIGURATION: S3Error.NoSuchObjectLockConfiguration,
618624
OBJECT_LOCK_CONFIGURATION_NOT_FOUND_ERROR: S3Error.ObjectLockConfigurationNotFoundError,

src/server/object_services/object_server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ function check_quota(bucket) {
17001700
if (major_messages.length > 0) {
17011701
const message = major_messages.join();
17021702
dbg.error(message);
1703-
throw new RpcError('INVALID_BUCKET_STATE', message);
1703+
throw new RpcError('OBJECT_QUOTA_EXCEEDED', message);
17041704
}
17051705
}
17061706

0 commit comments

Comments
 (0)