Skip to content

Commit 14e8f99

Browse files
committed
Merge #8810: tests: Add exception error message for JSONRPCException
42f6aed tests: Add exception error message for JSONRPCException (Wladimir J. van der Laan)
2 parents 920ca1f + 42f6aed commit 14e8f99

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

qa/rpc-tests/test_framework/authproxy.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@
5555

5656
class JSONRPCException(Exception):
5757
def __init__(self, rpc_error):
58-
Exception.__init__(self)
58+
try:
59+
errmsg = '%(message)s (%(code)i)' % rpc_error
60+
except (KeyError, TypeError):
61+
errmsg = ''
62+
Exception.__init__(self, errmsg)
5963
self.error = rpc_error
6064

6165

0 commit comments

Comments
 (0)