more complete admin API #298

Merged
lx merged 48 commits from admin-api into main 2022-05-24 10:16:40 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 8b1338ef2f - Show all commits

View file

@ -95,7 +95,7 @@ pub async fn handle_get_bucket_info(
.bucket_helper() .bucket_helper()
.resolve_global_bucket_name(&ga) .resolve_global_bucket_name(&ga)
.await? .await?
.ok_or_bad_request("Bucket not found")?, .ok_or_else(|| HelperError::NoSuchBucket(ga.to_string()))?,
_ => { _ => {
return Err(Error::bad_request( return Err(Error::bad_request(
"Either id or globalAlias must be provided (but not both)", "Either id or globalAlias must be provided (but not both)",

View file

@ -2,7 +2,7 @@ use err_derive::Error;
use hyper::header::HeaderValue; use hyper::header::HeaderValue;
use hyper::{Body, HeaderMap, StatusCode}; use hyper::{Body, HeaderMap, StatusCode};
use garage_model::helper::error::Error as HelperError; pub use garage_model::helper::error::Error as HelperError;
use crate::common_error::CommonError; use crate::common_error::CommonError;
pub use crate::common_error::{CommonErrorDerivative, OkOrBadRequest, OkOrInternalError}; pub use crate::common_error::{CommonErrorDerivative, OkOrBadRequest, OkOrInternalError};