Merge pull request #2034 from timnyborg/patch-1

correct rendering of jsonrpcerrors
This commit is contained in:
mdipierro
2018-11-01 08:19:32 -07:00
committed by GitHub
+3 -1
View File
@@ -34,7 +34,9 @@ import json
class JSONRPCError(RuntimeError):
"Error object for remote procedure call fail"
def __init__(self, code, message, data=''):
def __init__(self, code, message, data=''):
if isinstance(data, basestring):
data = [data]
value = "%s: %s\n%s" % (code, message, '\n'.join(data))
RuntimeError.__init__(self, value)
self.code = code