diff options
author | Alex Auvolat <lx@deuxfleurs.fr> | 2025-01-29 19:14:34 +0100 |
---|---|---|
committer | Alex Auvolat <lx@deuxfleurs.fr> | 2025-01-29 19:14:34 +0100 |
commit | 9f3c7c3720d323bc9df3892197e6da5d89d1b84a (patch) | |
tree | 8e1abf81071116f71a3c969a7d5dfcf43d8c1703 /src/api/s3/copy.rs | |
parent | a1d081ee840b1727ba1b3f430638a1296738283e (diff) | |
download | garage-9f3c7c3720d323bc9df3892197e6da5d89d1b84a.tar.gz garage-9f3c7c3720d323bc9df3892197e6da5d89d1b84a.zip |
api: better handling of helper errors to distinguish error codes
Diffstat (limited to 'src/api/s3/copy.rs')
-rw-r--r-- | src/api/s3/copy.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/api/s3/copy.rs b/src/api/s3/copy.rs index e375a714..b67ace88 100644 --- a/src/api/s3/copy.rs +++ b/src/api/s3/copy.rs @@ -655,7 +655,8 @@ async fn get_copy_source(ctx: &ReqCtx, req: &Request<ReqBody>) -> Result<Object, let source_bucket_id = garage .bucket_helper() .resolve_bucket(&source_bucket.to_string(), api_key) - .await?; + .await + .map_err(pass_helper_error)?; if !api_key.allow_read(&source_bucket_id) { return Err(Error::forbidden(format!( |