Merge #8810: tests: Add exception error message for JSONRPCException

42f6aed tests: Add exception error message for JSONRPCException (Wladimir J. van der Laan)
pull/8809/head
Wladimir J. van der Laan 8 years ago
commit 14e8f9916b
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

@ -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

Loading…
Cancel
Save