wgtmac commented on code in PR #763:
URL: https://github.com/apache/iceberg-cpp/pull/763#discussion_r3446298836


##########
src/iceberg/catalog/rest/error_handlers.cc:
##########
@@ -104,37 +122,34 @@ Status DropNamespaceErrorHandler::Accept(const 
ErrorResponse& error) const {
   return NamespaceErrorHandler::Accept(error);
 }
 
-const std::shared_ptr<TableErrorHandler>& TableErrorHandler::Instance() {
-  static const std::shared_ptr<TableErrorHandler> instance{new 
TableErrorHandler()};
+const std::shared_ptr<ConfigErrorHandler>& ConfigErrorHandler::Instance() {
+  static const std::shared_ptr<ConfigErrorHandler> instance{new 
ConfigErrorHandler()};
   return instance;
 }
 
-Status TableErrorHandler::Accept(const ErrorResponse& error) const {
-  switch (error.code) {
-    case 404:
-      if (error.type == kNoSuchNamespaceException) {
-        return NoSuchNamespace(error.message);
-      }
-      return NoSuchTable(error.message);
-    case 409:
-      return AlreadyExists(error.message);
+Status ConfigErrorHandler::Accept(const ErrorResponse& error) const {
+  if (error.code == 404 && !error.type.empty()) {

Review Comment:
   This catches fallback errors too. If /config returns a plain 404 (bad base 
URI, proxy, etc.), BuildDefaultErrorResponse sets type to RESTException, so we 
report NoSuchWarehouse instead of a REST error. Java only maps parsed typed 
404s here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to