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


##########
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:
   Good catched, fixed alone with a RESTException test case.



-- 
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