Skip to content

Commit 927180f

Browse files
committed
Merge branch 'issue-1576-jython-exception' into 'main'
Log Jython exceptions correctly during RCU pre-check See merge request weblogic-cloud/weblogic-deploy-tooling!1720
2 parents 7f5d073 + 553308f commit 927180f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/src/main/python/wlsdeploy/tool/util/rcu_helper.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import exceptions
66
import os
77
import re
8+
import sys
89

910
from java.io import File
1011
from java.lang import Class as JClass
@@ -69,6 +70,7 @@
6970
from wlsdeploy.tool.util.wlst_helper import WlstHelper
7071
from wlsdeploy.util import dictionary_utils
7172
from wlsdeploy.util import string_utils
73+
from wlsdeploy.util import unicode_helper as str_helper
7274
from wlsdeploy.util.model_context import ModelContext
7375

7476
POST_CREATE_RCU_SCHEMA_LOG_BASENAME = 'postCreateRcuSchemasScript'
@@ -283,7 +285,14 @@ def __precheck_rcu_connectivity(self):
283285
JClass.forName(jdbc_driver_name)
284286
DriverManager.getConnection(jdbc_conn_string, props)
285287

286-
except (exceptions.Exception, JException), e:
288+
except exceptions.Exception, e:
289+
exc_type, exc_obj, _exc_tb = sys.exc_info()
290+
ex = exception_helper.create_create_exception('WLSDPLY-12281', domain_typename,
291+
str_helper.to_string(exc_type),
292+
str_helper.to_string(exc_obj), error=e)
293+
self.__logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
294+
raise ex
295+
except JException, e:
287296
ex = exception_helper.create_create_exception('WLSDPLY-12281', domain_typename,
288297
e.getClass().getName(), e.getLocalizedMessage(), error=e)
289298
self.__logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)

0 commit comments

Comments
 (0)