From e6945b4a2a94d76d21cd0e6d2434364cbebfde03 Mon Sep 17 00:00:00 2001 From: Ivan Maslov Date: Thu, 17 Dec 2020 18:23:14 +0300 Subject: [PATCH] Add safe init CP when starts --- Orchestrator/OrchestratorSettings.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Orchestrator/OrchestratorSettings.py b/Orchestrator/OrchestratorSettings.py index 19c4e1b3..bbb3ac6c 100644 --- a/Orchestrator/OrchestratorSettings.py +++ b/Orchestrator/OrchestratorSettings.py @@ -49,12 +49,18 @@ if __name__ == "__main__": # New init way - allow run as module -m PyOpenRPA.Orc Orchestrator.UACSuperTokenUpdate(inGSettings=gSettings, inSuperTokenStr="1992-04-03-0643-ru-b4ff-openrpa52zzz") ## !!! For Relative import !!! CP Version Check - sys.path.insert(0,os.path.abspath(os.path.join(r""))) - from ControlPanel import CP_VersionCheck - CP_VersionCheck.SettingsUpdate(inGSettings=gSettings) + try: + sys.path.insert(0,os.path.abspath(os.path.join(r""))) + from ControlPanel import CP_VersionCheck + CP_VersionCheck.SettingsUpdate(inGSettings=gSettings) + except Exception as e: + gSettings["Logger"].exception(f"Exception when init CP. See below.") - from ControlPanel import CP_Test - CP_Test.SettingsUpdate(inGSettings=gSettings) + try: + from ControlPanel import CP_Test + CP_Test.SettingsUpdate(inGSettings=gSettings) + except Exception as e: + gSettings["Logger"].exception(f"Exception when init CP. See below.") # Call the orchestrator def Orchestrator.Orchestrator(inGSettings=gSettings)