Skip to content

Commit

Permalink
Merge pull request #7786 from DIRACGridBot/cherry-pick-2-83219e30d-in…
Browse files Browse the repository at this point in the history
…tegration

[sweep:integration] Avoid incorrect error strings in Workflow execute
  • Loading branch information
fstagni committed Sep 12, 2024
2 parents a1547e7 + d4c3725 commit ab23bf1
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 ab23bf1

Please sign in to comment.