Skip to content

Commit eb9e84d

Browse files
committed
1
1 parent 499c8df commit eb9e84d

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/iceberg/catalog/rest/http_client.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#include "iceberg/catalog/rest/http_client.h"
2121

22+
#include <expected>
23+
2224
#include <cpr/cpr.h>
2325
#include <nlohmann/json.hpp>
2426

@@ -113,7 +115,7 @@ ErrorResponse BuildDefaultErrorResponse(const cpr::Response& response) {
113115
/// \brief Tries to parse the response body as an ErrorResponse.
114116
Result<ErrorResponse> TryParseErrorResponse(const std::string& text) {
115117
if (text.empty()) {
116-
return ErrorResponse();
118+
return InvalidArgument("Empty response body");
117119
}
118120
ICEBERG_ASSIGN_OR_RAISE(auto json_result, FromJsonString(text));
119121
ICEBERG_ASSIGN_OR_RAISE(auto error_result, ErrorResponseFromJson(json_result));

src/iceberg/catalog/rest/rest_catalog.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ Result<std::unordered_map<std::string, std::string>> RestCatalog::GetNamespacePr
142142

143143
Status RestCatalog::DropNamespace(const Namespace& ns) {
144144
ICEBERG_ASSIGN_OR_RAISE(auto endpoint, paths_->Namespace_(ns));
145-
auto response_or_error =
146-
client_->Delete(endpoint, /*headers=*/{}, *DropNamespaceErrorHandler::Instance());
145+
ICEBERG_ASSIGN_OR_RAISE(
146+
const auto& response,
147+
client_->Delete(endpoint, /*headers=*/{}, *DropNamespaceErrorHandler::Instance()));
147148
return {};
148149
}
149150

0 commit comments

Comments
 (0)