From acf02950145908796849f2945e17b5975d13d10e Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Tue, 27 Sep 2016 15:19:58 +0200 Subject: [PATCH] Merge #8810: tests: Add exception error message for JSONRPCException 42f6aed tests: Add exception error message for JSONRPCException (Wladimir J. van der Laan) --- qa/rpc-tests/test_framework/authproxy.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qa/rpc-tests/test_framework/authproxy.py b/qa/rpc-tests/test_framework/authproxy.py index d095a56ce7..f5e0be20d1 100644 --- a/qa/rpc-tests/test_framework/authproxy.py +++ b/qa/rpc-tests/test_framework/authproxy.py @@ -55,7 +55,11 @@ log = logging.getLogger("BitcoinRPC") class JSONRPCException(Exception): def __init__(self, rpc_error): - Exception.__init__(self) + try: + errmsg = '%(message)s (%(code)i)' % rpc_error + except (KeyError, TypeError): + errmsg = '' + Exception.__init__(self, errmsg) self.error = rpc_error