Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/DIRAC/Core/Utilities/Proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions src/DIRAC/WorkloadManagementSystem/scripts/dirac_jobexec.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import DIRAC
from DIRAC.Core.Base.Script import Script
from DIRAC.Core.Utilities.ReturnValues import S_ERROR


@Script()
Expand Down Expand Up @@ -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:
Expand Down
Loading