Skip to content

Commit 16552d1

Browse files
committed
xmlrpc: catch errors in multicall and raise proper exception
1 parent 5561820 commit 16552d1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/pyrocore/util/xmlrpc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,13 @@ def __call__(self, *args, **kwargs):
173173
handle.close()
174174
raise
175175
else:
176-
return sum(result, []) if flatten else result
176+
try:
177+
return sum(result, []) if flatten else result
178+
except TypeError:
179+
if result and isinstance(result, list) and isinstance(result[0], dict) and 'faultCode' in result[0]:
180+
raise error.LoggableError("XMLRPC error in multicall: " + repr(result[0]))
181+
else:
182+
raise
177183
finally:
178184
# Calculate latency
179185
self._latency = time.time() - start

0 commit comments

Comments
 (0)