diff --git a/src/DIRAC/Core/Utilities/Proxy.py b/src/DIRAC/Core/Utilities/Proxy.py index ab8bbe158a1..f393c8c8172 100644 --- a/src/DIRAC/Core/Utilities/Proxy.py +++ b/src/DIRAC/Core/Utilities/Proxy.py @@ -160,10 +160,6 @@ def wrapped_fcn(*args, **kwargs): try: return fcn(*args, **kwargs) - except Exception as lException: # pylint: disable=broad-except - value = ",".join([str(arg) for arg in lException.args]) - exceptType = lException.__class__.__name__ - return S_ERROR(f"Exception - {exceptType}: {value}") finally: # Restore the default host certificate usage if necessary if useServerCertificate: diff --git a/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py b/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py index e4d7ae198df..84844a56c4a 100755 --- a/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py +++ b/src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py @@ -9,6 +9,7 @@ import DIRAC from DIRAC.Core.Base.Script import Script +from DIRAC.Core.Utilities.ReturnValues import S_ERROR @Script() @@ -87,9 +88,13 @@ def jobexec(jobxml, wfParameters): parDict[name] = value gLogger.debug("PYTHONPATH:\n%s" % ("\n".join(sys.path))) - jobExec = jobexec(jobXMLfile, parDict) + try: + jobExec = jobexec(jobXMLfile, parDict) + except Exception as e: + gLogger.exception("Workflow execution failed") + jobExec = S_ERROR(f"Workflow execution failed: {e}") if not jobExec["OK"]: - gLogger.debug("Workflow execution finished with errors, exiting") + gLogger.notice("Workflow execution finished with errors, exiting") if jobExec["Errno"]: sys.exit(jobExec["Errno"]) else: