You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/01/06 01:40:27 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a change in pull request #7631: [python] Fix database error handler about no datasource name

zhongjiajie commented on a change in pull request #7631:
URL: https://github.com/apache/dolphinscheduler/pull/7631#discussion_r779246113



##########
File path: dolphinscheduler-python/pydolphinscheduler/src/pydolphinscheduler/core/database.py
##########
@@ -52,5 +55,10 @@ def get_database_info(self, name) -> Dict:
             return self._database
         else:
             gateway = launch_gateway()
-            self._database = gateway.entry_point.getDatasourceInfo(name)
+            try:
+                self._database = gateway.entry_point.getDatasourceInfo(name)
+            # Handler database source do not exists error, for now we just terminate the process.
+            except Py4JJavaError:

Review comment:
       It seems that `Py4JJavaError` only has one single subclass `java_exception`. https://www.py4j.org/py4j_java_protocol.html#py4j.protocol.Py4JJavaError. And it more like we could get detail java gateway information from client-side. But I would try it in my local environment.




-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org