noidname01 commented on code in PR #4345:
URL: https://github.com/apache/gravitino/pull/4345#discussion_r1705438329
##########
clients/client-python/gravitino/exceptions/base.py:
##########
@@ -95,6 +95,18 @@ class UnknownError(RuntimeError):
"""An exception thrown when other unknown exception is thrown"""
+class ConnectionFailedException(GravitinoRuntimeException):
+ """An exception thrown when connect to catalog failed."""
+
+
+class NoSuchCatalogException(NotFoundException):
Review Comment:
This class is redefined.
##########
clients/client-python/tests/unittests/test_error_handler.py:
##########
@@ -151,6 +155,46 @@ def test_metalake_error_handler(self):
ErrorResponse.generate_error_response(Exception, "mock error")
)
+
+ def test_catalog_error_handler(self):
+
+ with self.assertRaises(ConnectionFailedException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ ConnectionFailedException, "mock error"
+ )
+ )
+
+ with self.assertRaises(NoSuchMetalakeException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ NoSuchMetalakeException, "mock error"
+ )
+ )
+
+ with self.assertRaises(NoSuchCatalogException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ NoSuchCatalogException, "mock error"
+ )
+ )
+
+ with self.assertRaises(CatalogAlreadyExistsException):
+ CATALOG_ERROR_HANDLER.handle(
+ ErrorResponse.generate_error_response(
+ CatalogAlreadyExistsException, "mock error"
Review Comment:
There are two right parenthesis missing.
--
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]