File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
qa/rpc-tests/test_framework Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 42
42
import decimal
43
43
import json
44
44
import logging
45
+ import socket
45
46
try :
46
47
import urllib .parse as urlparse
47
48
except ImportError :
@@ -161,7 +162,15 @@ def _batch(self, rpc_call_list):
161
162
return self ._request ('POST' , self .__url .path , postdata .encode ('utf-8' ))
162
163
163
164
def _get_response (self ):
164
- http_response = self .__conn .getresponse ()
165
+ try :
166
+ http_response = self .__conn .getresponse ()
167
+ except socket .timeout as e :
168
+ raise JSONRPCException ({
169
+ 'code' : - 344 ,
170
+ 'message' : '%r RPC took longer than %f seconds. Consider '
171
+ 'using larger timeout for calls that take '
172
+ 'longer to return.' % (self ._service_name ,
173
+ self .__conn .timeout )})
165
174
if http_response is None :
166
175
raise JSONRPCException ({
167
176
'code' : - 342 , 'message' : 'missing HTTP response from server' })
You can’t perform that action at this time.
0 commit comments