[dep-upgrade-202402] rename BytesBody into ErrorBody for clarity

This commit is contained in:
Alex Auvolat
2024-02-07 14:45:52 +01:00
parent fe48d60d2b
commit e524e7a30d
6 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -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)
}
}