質問編集履歴
1
エラー文の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -34,14 +34,14 @@
|
|
34
34
|
--> 601 chunked=chunked)
|
35
35
|
602
|
36
36
|
|
37
|
-
|
37
|
+
|
38
38
|
386 # otherwise it looks like a programming error was the cause.
|
39
39
|
--> 387 six.raise_from(e, None)
|
40
40
|
388 except (SocketTimeout, BaseSSLError, SocketError) as e:
|
41
41
|
|
42
42
|
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/packages/six.py in raise_from(value, from_value)
|
43
43
|
|
44
|
-
|
44
|
+
|
45
45
|
382 try:
|
46
46
|
--> 383 httplib_response = conn.getresponse()
|
47
47
|
384 except Exception as e:
|
@@ -56,7 +56,7 @@
|
|
56
56
|
--> 297 version, status, reason = self._read_status()
|
57
57
|
298 if status != CONTINUE:
|
58
58
|
|
59
|
-
|
59
|
+
|
60
60
|
265 # sending a valid response.
|
61
61
|
--> 266 raise RemoteDisconnected("Remote end closed connection without"
|
62
62
|
267 " response")
|
@@ -66,7 +66,7 @@
|
|
66
66
|
During handling of the above exception, another exception occurred:
|
67
67
|
|
68
68
|
ProtocolError Traceback (most recent call last)
|
69
|
-
|
69
|
+
|
70
70
|
439 retries=self.max_retries,
|
71
71
|
--> 440 timeout=timeout
|
72
72
|
441 )
|
@@ -76,17 +76,17 @@
|
|
76
76
|
--> 639 _stacktrace=sys.exc_info()[2])
|
77
77
|
640 retries.sleep()
|
78
78
|
|
79
|
-
|
79
|
+
|
80
80
|
356 if read is False or not self._is_method_retryable(method):
|
81
81
|
--> 357 raise six.reraise(type(error), error, _stacktrace)
|
82
82
|
358 elif read is not None:
|
83
83
|
|
84
|
-
|
84
|
+
|
85
85
|
684 if value.__traceback__ is not tb:
|
86
86
|
--> 685 raise value.with_traceback(tb)
|
87
87
|
686 raise value
|
88
88
|
|
89
|
-
|
89
|
+
|
90
90
|
600 body=body, headers=headers,
|
91
91
|
--> 601 chunked=chunked)
|
92
92
|
602
|
@@ -101,4 +101,93 @@
|
|
101
101
|
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
|
102
102
|
382 try:
|
103
103
|
--> 383 httplib_response = conn.getresponse()
|
104
|
-
384 except Exception as e:
|
104
|
+
384 except Exception as e:
|
105
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in getresponse(self)
|
106
|
+
1330 try:
|
107
|
+
-> 1331 response.begin()
|
108
|
+
1332 except ConnectionError:
|
109
|
+
|
110
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in begin(self)
|
111
|
+
296 while True:
|
112
|
+
--> 297 version, status, reason = self._read_status()
|
113
|
+
298 if status != CONTINUE:
|
114
|
+
|
115
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py in _read_status(self)
|
116
|
+
265 # sending a valid response.
|
117
|
+
--> 266 raise RemoteDisconnected("Remote end closed connection without"
|
118
|
+
267 " response")
|
119
|
+
|
120
|
+
ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
|
121
|
+
|
122
|
+
During handling of the above exception, another exception occurred:
|
123
|
+
|
124
|
+
ConnectionError Traceback (most recent call last)
|
125
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ccxt/base/exchange.py in fetch(self, url, method, headers, body)
|
126
|
+
422 timeout=int(self.timeout / 1000),
|
127
|
+
--> 423 proxies=self.proxies
|
128
|
+
424 )
|
129
|
+
|
130
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
|
131
|
+
507 send_kwargs.update(settings)
|
132
|
+
--> 508 resp = self.send(prep, **send_kwargs)
|
133
|
+
509
|
134
|
+
|
135
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py in send(self, request, **kwargs)
|
136
|
+
617 # Send the request
|
137
|
+
--> 618 r = adapter.send(request, **kwargs)
|
138
|
+
619
|
139
|
+
|
140
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
|
141
|
+
489 except (ProtocolError, socket.error) as err:
|
142
|
+
--> 490 raise ConnectionError(err, request=request)
|
143
|
+
491
|
144
|
+
|
145
|
+
ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
|
146
|
+
|
147
|
+
During handling of the above exception, another exception occurred:
|
148
|
+
|
149
|
+
NetworkError Traceback (most recent call last)
|
150
|
+
<ipython-input-360-b459938ea1de> in <module>()
|
151
|
+
22 mex_ticker=mex.fetch_ticker(symbol='BTC/USD')
|
152
|
+
---> 23 fly_ticker=fly.fetch_ticker(symbol='BTC/JPY')
|
153
|
+
24 except NetworkError:
|
154
|
+
|
155
|
+
|
156
|
+
167 'product_code': self.market_id(symbol),
|
157
|
+
--> 168 }, params))
|
158
|
+
169 timestamp = self.parse8601(ticker['timestamp'])
|
159
|
+
|
160
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ccxt/base/exchange.py in request(self, path, api, method, params, headers, body)
|
161
|
+
361 def request(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
162
|
+
--> 362 return self.fetch2(path, api, method, params, headers, body)
|
163
|
+
363
|
164
|
+
|
165
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ccxt/base/exchange.py in fetch2(self, path, api, method, params, headers, body)
|
166
|
+
358 request = self.sign(path, api, method, params, headers, body)
|
167
|
+
--> 359 return self.fetch(request['url'], request['method'], request['headers'], request['body'])
|
168
|
+
360
|
169
|
+
|
170
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ccxt/base/exchange.py in fetch(self, url, method, headers, body)
|
171
|
+
452 if ('ECONNRESET' in error_string) or ('Connection aborted.' in error_string):
|
172
|
+
--> 453 self.raise_error(NetworkError, url, method, e)
|
173
|
+
454 else:
|
174
|
+
|
175
|
+
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ccxt/base/exchange.py in raise_error(self, exception_type, url, method, error, details)
|
176
|
+
343 output = ' '.join([self.id] + [var for var in (url, method, error, details) if var is not None])
|
177
|
+
--> 344 raise exception_type(output)
|
178
|
+
345
|
179
|
+
|
180
|
+
NetworkError: bitflyer https://api.bitflyer.jp/v1/getticker?product_code=BTC_JPY GET ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
|
181
|
+
|
182
|
+
During handling of the above exception, another exception occurred:
|
183
|
+
|
184
|
+
NameError Traceback (most recent call last)
|
185
|
+
<ipython-input-360-b459938ea1de> in <module>()
|
186
|
+
22 mex_ticker=mex.fetch_ticker(symbol='BTC/USD')
|
187
|
+
23 fly_ticker=fly.fetch_ticker(symbol='BTC/JPY')
|
188
|
+
---> 24 except NetworkError:
|
189
|
+
25 time.sleep(3)
|
190
|
+
26 traceback.print_exc()
|
191
|
+
|
192
|
+
NameError: name 'NetworkError' is not defined
|
193
|
+
```
|