More error refactoring

This commit is contained in:
Alex Auvolat
2022-05-13 15:21:32 +02:00
parent f82b938033
commit 7a5d329e49
12 changed files with 37 additions and 54 deletions
+2 -2
View File
@@ -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 ---