Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/baseclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void BaseClient::HandleRedirectResponse(std::string& code, std::string& message,
}

Result<Response> BaseClient::GetErrorResponse(http::Response resp,
std::string_view resource,
std::string_view,
http::Method method,
const std::string& bucket_name,
const std::string& object_name) {
Expand Down
24 changes: 18 additions & 6 deletions src/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ struct ScopedRDMARegistration {

} // namespace

ListObjectsResult::ListObjectsResult(error::Error err) : failed_(true) {
ListObjectsResult::ListObjectsResult(error::Error) : failed_(true) {
resp_ = std::make_shared<ListObjectsResponse>();
itr_ = resp_->contents.end();
}
Expand Down Expand Up @@ -384,7 +384,7 @@ void ListObjectsResult::Populate() {
}
}

RemoveObjectsResult::RemoveObjectsResult(error::Error err) {
RemoveObjectsResult::RemoveObjectsResult(error::Error) {
done_ = true;
itr_ = resp_.errors.end();
}
Expand Down Expand Up @@ -1023,7 +1023,10 @@ Result<ComposeObjectResponse> Client::ComposeObject(ComposeObjectArgs args) {
amu_args.region = args.region;
amu_args.object = args.object;
amu_args.upload_id = upload_id;
AbortMultipartUpload(amu_args);
if (auto amu_resp = AbortMultipartUpload(amu_args); !amu_resp) {
std::cerr << "warning: unable to abort multipart upload: "
<< amu_resp.error().String() << std::endl;
}
}

return resp;
Expand Down Expand Up @@ -1586,7 +1589,10 @@ Result<PutObjectResponse> Client::PutObject(PutObjectArgs args) {
amu_args.region = std::move(args.region);
amu_args.object = std::move(args.object);
amu_args.upload_id = upload_id;
AbortMultipartUpload(amu_args);
if (auto amu_resp = AbortMultipartUpload(amu_args); !amu_resp) {
std::cerr << "warning: unable to abort multipart upload: "
<< amu_resp.error().String() << std::endl;
}
}
return tl::make_unexpected(first_err);
}
Expand All @@ -1611,7 +1617,10 @@ Result<PutObjectResponse> Client::PutObject(PutObjectArgs args) {
amu_args.region = std::move(args.region);
amu_args.object = std::move(args.object);
amu_args.upload_id = upload_id;
AbortMultipartUpload(amu_args);
if (auto amu_resp = AbortMultipartUpload(amu_args); !amu_resp) {
std::cerr << "warning: unable to abort multipart upload: "
<< amu_resp.error().String() << std::endl;
}
}
if (!cmu_resp) {
return tl::make_unexpected(cmu_resp.error());
Expand Down Expand Up @@ -1658,7 +1667,10 @@ Result<PutObjectResponse> Client::PutObject(PutObjectArgs args) {
amu_args.region = std::move(args.region);
amu_args.object = std::move(args.object);
amu_args.upload_id = upload_id;
AbortMultipartUpload(amu_args);
if (auto amu_resp = AbortMultipartUpload(amu_args); !amu_resp) {
std::cerr << "warning: unable to abort multipart upload: "
<< amu_resp.error().String() << std::endl;
}
}

return resp;
Expand Down
40 changes: 32 additions & 8 deletions tests/tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,10 @@ class Tests {
try {
minio::s3::RemoveBucketArgs args;
args.bucket = b;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << b << ": "
<< rm_resp.error().String() << std::endl;
}
} catch (...) {
}
};
Expand Down Expand Up @@ -1101,7 +1104,10 @@ class Tests {
} catch (const std::runtime_error&) {
minio::s3::RemoveBucketArgs args;
args.bucket = bucket_name;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << bucket_name
<< ": " << rm_resp.error().String() << std::endl;
}
throw;
}
}
Expand Down Expand Up @@ -1243,7 +1249,10 @@ class Tests {
} catch (const std::runtime_error&) {
minio::s3::RemoveBucketArgs args;
args.bucket = bucket_name;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << bucket_name
<< ": " << rm_resp.error().String() << std::endl;
}
throw;
}
}
Expand Down Expand Up @@ -1296,7 +1305,10 @@ class Tests {
try {
minio::s3::RemoveBucketArgs args;
args.bucket = b;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << b << ": "
<< rm_resp.error().String() << std::endl;
}
} catch (...) {
}
}
Expand Down Expand Up @@ -1371,7 +1383,10 @@ class Tests {
{
minio::s3::RemoveBucketArgs args;
args.bucket = bucket_name;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << bucket_name
<< ": " << rm_resp.error().String() << std::endl;
}
}
}

Expand Down Expand Up @@ -1405,7 +1420,10 @@ class Tests {
{
minio::s3::RemoveBucketArgs args;
args.bucket = bucket_name;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << bucket_name
<< ": " << rm_resp.error().String() << std::endl;
}
}
}

Expand Down Expand Up @@ -1439,7 +1457,10 @@ class Tests {
{
minio::s3::RemoveBucketArgs args;
args.bucket = bucket_name;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << bucket_name
<< ": " << rm_resp.error().String() << std::endl;
}
}
}

Expand Down Expand Up @@ -1473,7 +1494,10 @@ class Tests {
{
minio::s3::RemoveBucketArgs args;
args.bucket = bucket_name;
client_.RemoveBucket(args);
if (auto rm_resp = client_.RemoveBucket(args); !rm_resp) {
std::cout << "warning: unable to remove bucket " << bucket_name
<< ": " << rm_resp.error().String() << std::endl;
}
}
}

Expand Down
Loading