Skip to content

Commit

Permalink
Merge pull request #7785 from sfayer/fix_workflowerrmsg
Browse files Browse the repository at this point in the history
[8.0] Avoid incorrect error strings in Workflow execute
  • Loading branch information
fstagni authored Sep 12, 2024
2 parents 4d3ee69 + faac633 commit 83219e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DIRAC/Workflow/Modules/ModuleBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ def execute(self):
# In this case the RuntimeError is supposed to return in rte[1] an error code (possibly from DErrno)
self.log.error(rte.args[0])
self.setApplicationStatus(rte.args[0])
return S_ERROR(rte.args[1], rte.args[0]) # rte[1] should be an error code
# rte.args[1] may be a shell exit code, not an error code: If we pass it to S_ERROR directly
# it will prefix the error message with the wrong description in that case.
# Instead we set the Errno manually afterwards which leaves the message unchanged.
res = S_ERROR(rte.args[0])
res["Errno"] = rte.args[1]
return res

# If we are here it is just a string
self.log.error(rte)
Expand Down

0 comments on commit 83219e3

Please sign in to comment.