Skip to content

Commit c202846

Browse files
authored
Merge pull request #7093 from chaen/v8.0_refactor_jobSubmit
[v8.0] refactor job submit
2 parents 2c2fce9 + e55fd0c commit c202846

File tree

3 files changed

+234
-211
lines changed

3 files changed

+234
-211
lines changed

src/DIRAC/Core/Utilities/ReturnValues.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def __init__(self, result: DErrorReturnType | str, errCode: int = 0):
200200
self.result = cast(DErrorReturnType, result)
201201

202202

203-
def returnValueOrRaise(result: DReturnType[T]) -> T:
203+
def returnValueOrRaise(result: DReturnType[T], *, errorCode: int = 0) -> T:
204204
"""Unwrap an S_OK/S_ERROR response into a value or Exception
205205
206206
This method assists with using exceptions in DIRAC code by raising
@@ -217,7 +217,7 @@ def returnValueOrRaise(result: DReturnType[T]) -> T:
217217
if "ExecInfo" in result:
218218
raise result["ExecInfo"][0]
219219
else:
220-
raise SErrorException(result)
220+
raise SErrorException(result, errorCode)
221221
return result["Value"]
222222

223223

0 commit comments

Comments
 (0)