Skip to content

Commit

Permalink
Default error code -1
Browse files Browse the repository at this point in the history
  • Loading branch information
Liquid369 committed Oct 28, 2024
1 parent 9535a68 commit 0ef99ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/functional/test_framework/authproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ def __call__(self, *args, **argsn):
postdata = json.dumps(self.get_request(*args, **argsn), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)
response, status = self._request('POST', self.__url.path, postdata.encode('utf-8'))

if response.get('error') is not None:
raise JSONRPCException({'error': response['error'], 'status': status})
error_response = response['error']
if 'code' not in error_response:
error_response['code'] = -1
raise JSONRPCException({'error': error_response, 'status': status})
elif 'result' not in response:
raise JSONRPCException({
'code': -343, 'message': 'missing JSON-RPC result'})
Expand Down

0 comments on commit 0ef99ef

Please sign in to comment.