diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-09-27 15:19:58 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-09-27 15:20:30 +0200 |
| commit | 14e8f9916bebf01d3cd6fc89c704bd870bf50760 (patch) | |
| tree | 1c09a18cf59172f78a3ff30a910776a9bd167124 | |
| parent | Merge #8655: Do not shadow variables (trivials) (diff) | |
| parent | tests: Add exception error message for JSONRPCException (diff) | |
| download | discoin-14e8f9916bebf01d3cd6fc89c704bd870bf50760.tar.xz discoin-14e8f9916bebf01d3cd6fc89c704bd870bf50760.zip | |
Merge #8810: tests: Add exception error message for JSONRPCException
42f6aed tests: Add exception error message for JSONRPCException (Wladimir J. van der Laan)
| -rw-r--r-- | qa/rpc-tests/test_framework/authproxy.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qa/rpc-tests/test_framework/authproxy.py b/qa/rpc-tests/test_framework/authproxy.py index d095a56ce..f5e0be20d 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 |