Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/authproxy.py
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | def _get_response(self): | ||||
req_start_time = time.time() | req_start_time = time.time() | ||||
try: | try: | ||||
http_response = self.__conn.getresponse() | http_response = self.__conn.getresponse() | ||||
except socket.timeout: | except socket.timeout: | ||||
raise JSONRPCException({ | raise JSONRPCException({ | ||||
'code': -344, | 'code': -344, | ||||
'message': '{!r} RPC took longer than {} seconds. Consider ' | 'message': '{!r} RPC took longer than {} seconds. Consider ' | ||||
'using larger timeout for calls that take ' | 'using larger timeout for calls that take ' | ||||
'longer to return.'.format((self._service_name, | 'longer to return.'.format(self._service_name, | ||||
self.__conn.timeout))}) | self.__conn.timeout)}) | ||||
if http_response is None: | if http_response is None: | ||||
raise JSONRPCException({ | raise JSONRPCException({ | ||||
'code': -342, 'message': 'missing HTTP response from server'}) | 'code': -342, 'message': 'missing HTTP response from server'}) | ||||
content_type = http_response.getheader('Content-Type') | content_type = http_response.getheader('Content-Type') | ||||
if content_type != 'application/json': | if content_type != 'application/json': | ||||
raise JSONRPCException({ | raise JSONRPCException({ | ||||
'code': -342, 'message': 'non-JSON HTTP response with \'{} {}\' from server'.format( | 'code': -342, 'message': 'non-JSON HTTP response with \'{} {}\' from server'.format( | ||||
Show All 14 Lines |