mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-25 20:06:53 +00:00
api: better handling of helper errors to distinguish error codes
This commit is contained in:
@@ -107,7 +107,8 @@ pub async fn handle_post_object(
|
||||
let bucket_id = garage
|
||||
.bucket_helper()
|
||||
.resolve_bucket(&bucket_name, &api_key)
|
||||
.await?;
|
||||
.await
|
||||
.map_err(pass_helper_error)?;
|
||||
|
||||
if !api_key.allow_write(&bucket_id) {
|
||||
return Err(Error::forbidden("Operation is not allowed for this key."));
|
||||
|
||||
Reference in New Issue
Block a user