[bug] S3 error responses are not being logged #29
This commit is contained in:
parent
4e86f2a7de
commit
bc43338127
@ -955,10 +955,13 @@ auto s3_provider::remove_file_impl(const std::string &api_path) -> api_error {
|
|||||||
auto object_name =
|
auto object_name =
|
||||||
utils::path::create_api_path(is_encrypted ? key : api_path);
|
utils::path::create_api_path(is_encrypted ? key : api_path);
|
||||||
|
|
||||||
curl::requests::http_delete del{};
|
std::string response_data : curl::requests::http_delete del{};
|
||||||
del.allow_timeout = true;
|
del.allow_timeout = true;
|
||||||
del.aws_service = "aws:amz:" + cfg.region + ":s3";
|
del.aws_service = "aws:amz:" + cfg.region + ":s3";
|
||||||
del.path = object_name;
|
del.path = object_name;
|
||||||
|
del.response_handler = [&response_data](auto &&data, long /*response_code*/) {
|
||||||
|
response_data = std::string(data.begin(), data.end());
|
||||||
|
};
|
||||||
|
|
||||||
long response_code{};
|
long response_code{};
|
||||||
stop_type stop_requested{};
|
stop_type stop_requested{};
|
||||||
@ -972,8 +975,9 @@ auto s3_provider::remove_file_impl(const std::string &api_path) -> api_error {
|
|||||||
if ((response_code < http_error_codes::ok ||
|
if ((response_code < http_error_codes::ok ||
|
||||||
response_code >= http_error_codes::multiple_choices) &&
|
response_code >= http_error_codes::multiple_choices) &&
|
||||||
response_code != http_error_codes::not_found) {
|
response_code != http_error_codes::not_found) {
|
||||||
utils::error::raise_api_path_error(function_name, api_path, response_code,
|
utils::error::raise_api_path_error(
|
||||||
"failed to remove file");
|
function_name, api_path, response_code,
|
||||||
|
fmt::format("failed to remove file|response|{}", response_data));
|
||||||
return api_error::comm_error;
|
return api_error::comm_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user