aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin/bucket.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-13 15:21:32 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-13 15:21:32 +0200
commit7a5d329e49cc7018cbfa14d37589f51860f66cf0 (patch)
tree50be9a5eea1b2415bb541aff0c8cb33c0f47b8e4 /src/api/admin/bucket.rs
parentf82b938033f1a01a136315b5f37ecb89b78bca0c (diff)
downloadgarage-7a5d329e49cc7018cbfa14d37589f51860f66cf0.tar.gz
garage-7a5d329e49cc7018cbfa14d37589f51860f66cf0.zip
More error refactoring
Diffstat (limited to 'src/api/admin/bucket.rs')
-rw-r--r--src/api/admin/bucket.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/admin/bucket.rs b/src/api/admin/bucket.rs
index db1fda0f..b226c015 100644
--- a/src/api/admin/bucket.rs
+++ b/src/api/admin/bucket.rs
@@ -18,7 +18,7 @@ use garage_model::s3::object_table::ObjectFilter;
use crate::admin::error::*;
use crate::admin::key::ApiBucketKeyPerm;
-use crate::admin::parse_json_body;
+use crate::helpers::parse_json_body;
pub async fn handle_list_buckets(garage: &Arc<Garage>) -> Result<Response<Body>, Error> {
let buckets = garage
@@ -333,7 +333,7 @@ pub async fn handle_delete_bucket(
)
.await?;
if !objects.is_empty() {
- return Err(Error::bad_request("Bucket is not empty"));
+ return Err(Error::BucketNotEmpty);
}
// --- done checking, now commit ---