Skip to content

Commit

Permalink
Added a fix for wrong status value returing InternalServer Error
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Chouhan <[email protected]>
  • Loading branch information
achouhan09 committed Jan 8, 2025
1 parent 84a4218 commit f85d0fb
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/endpoint/s3/ops/s3_put_bucket_lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,19 @@ async function put_bucket_lifecycle(req) {
return current_rule;
});

await req.object_sdk.set_bucket_lifecycle_configuration_rules({
name: req.params.bucket,
rules: lifecycle_rules
});
try {
await req.object_sdk.set_bucket_lifecycle_configuration_rules({
name: req.params.bucket,
rules: lifecycle_rules
});
} catch (error) {
let err = error;
if (error.rpc_code === "INVALID_SCHEMA" || error.rpc_code === "INVALID_SCHEMA_PARAMS") {
err = new S3Error(S3Error.MalformedXML);
err.message = "The XML you provided was not well-formed or did not validate against our published schema";
}
throw err;
}

dbg.log0('set_bucket_lifecycle', lifecycle_rules);
}
Expand Down

0 comments on commit f85d0fb

Please sign in to comment.