diff options
author | Alex Auvolat <alex@adnab.me> | 2024-02-07 14:45:52 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2024-02-07 14:45:52 +0100 |
commit | e524e7a30d4d81c84f1c110017ad972dc5617bf6 (patch) | |
tree | 446b074e199c47c109fa517e5ec6717c2fe15b5f /src/api/admin/error.rs | |
parent | fe48d60d2b63a9914297558bd5dbccae8d96c947 (diff) | |
download | garage-e524e7a30d4d81c84f1c110017ad972dc5617bf6.tar.gz garage-e524e7a30d4d81c84f1c110017ad972dc5617bf6.zip |
[dep-upgrade-202402] rename BytesBody into ErrorBody for clarity
Diffstat (limited to 'src/api/admin/error.rs')
-rw-r--r-- | src/api/admin/error.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/admin/error.rs b/src/api/admin/error.rs index 011c903f..2668b42d 100644 --- a/src/api/admin/error.rs +++ b/src/api/admin/error.rs @@ -7,7 +7,7 @@ pub use garage_model::helper::error::Error as HelperError; use crate::common_error::CommonError; pub use crate::common_error::{CommonErrorDerivative, OkOrBadRequest, OkOrInternalError}; use crate::generic_server::ApiError; -use crate::helpers::{BytesBody, CustomApiErrorBody}; +use crate::helpers::*; /// Errors of this crate #[derive(Debug, Error)] @@ -65,7 +65,7 @@ impl ApiError for Error { header_map.append(header::CONTENT_TYPE, "application/json".parse().unwrap()); } - fn http_body(&self, garage_region: &str, path: &str) -> BytesBody { + fn http_body(&self, garage_region: &str, path: &str) -> ErrorBody { let error = CustomApiErrorBody { code: self.code().to_string(), message: format!("{}", self), @@ -81,6 +81,6 @@ impl ApiError for Error { "# .into() }); - BytesBody::from(bytes::Bytes::from(error_str.into_bytes())) + error_body(error_str) } } |