|
4 | 4 |
|
5 | 5 | The entry point for the discoverDomain tool. |
6 | 6 | """ |
| 7 | +import exceptions |
7 | 8 | import os |
8 | 9 | import sys |
9 | 10 |
|
@@ -234,6 +235,7 @@ def __discover(model_context, aliases, credential_injector, helper): |
234 | 235 | model = Model() |
235 | 236 | base_location = LocationContext() |
236 | 237 | __connect_to_domain(model_context, helper) |
| 238 | + |
237 | 239 | try: |
238 | 240 | _add_domain_name(base_location, aliases, helper) |
239 | 241 | DomainInfoDiscoverer(model_context, model.get_model_domain_info(), base_location, wlst_mode=__wlst_mode, |
@@ -367,6 +369,7 @@ def __disconnect_domain(helper): |
367 | 369 | _method_name = '__disconnect_domain' |
368 | 370 |
|
369 | 371 | __logger.entering(class_name=_class_name, method_name=_method_name) |
| 372 | + |
370 | 373 | if __wlst_mode == WlstModes.ONLINE: |
371 | 374 | try: |
372 | 375 | helper.disconnect() |
@@ -571,7 +574,6 @@ def main(args): |
571 | 574 | :return: |
572 | 575 | """ |
573 | 576 | _method_name = 'main' |
574 | | - |
575 | 577 | __logger.entering(class_name=_class_name, method_name=_method_name) |
576 | 578 | for index, arg in enumerate(args): |
577 | 579 | __logger.finer('sys.argv[{0}] = {1}', str(index), str(arg), class_name=_class_name, method_name=_method_name) |
@@ -638,4 +640,9 @@ def main(args): |
638 | 640 |
|
639 | 641 | if __name__ == '__main__' or __name__ == 'main': |
640 | 642 | WebLogicDeployToolingVersion.logVersionInfo(_program_name) |
641 | | - main(sys.argv) |
| 643 | + try: |
| 644 | + main(sys.argv) |
| 645 | + except exceptions.SystemExit, ex: |
| 646 | + raise ex |
| 647 | + except (exceptions.Exception, java.lang.Exception), ex: |
| 648 | + exception_helper.__handle_unexpected_exception(ex, _program_name, _class_name, __logger) |
0 commit comments