Skip to content

Commit 0ef99ef

Browse files
committed
Default error code -1
1 parent 9535a68 commit 0ef99ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/functional/test_framework/authproxy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ def __call__(self, *args, **argsn):
138138
postdata = json.dumps(self.get_request(*args, **argsn), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)
139139
response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))
140140

141-
if response.get('error') is not None:
142-
raise JSONRPCException({'error': response['error'], 'status': status})
141+
error_response = response['error']
142+
if 'code' not in error_response:
143+
error_response['code'] = -1
144+
raise JSONRPCException({'error': error_response, 'status': status})
143145
elif 'result' not in response:
144146
raise JSONRPCException({
145147
'code': -343, 'message': 'missing JSON-RPC result'})

0 commit comments

Comments
 (0)