能否增加个出现 HTTP Error 502 的时候,自动重启的功能?
————————————————————————————————————————————
错误如下:
Traceback (most recent call last):
File "main.py", line 24, in
book = wqxtDownloader( bid );
File "C:\Users\83669\Desktop\wqxuetang_downloader-master (1)\wqxuetang_downloader-master\wqxtDownloader.py", line 36, in init
self.catatree = self.getCatatree();
File "C:\Users\83669\Desktop\wqxuetang_downloader-master (1)\wqxuetang_downloader-master\wqxtDownloader.py", line 84, in getCatatree
request = curl.request.urlopen(url);
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 569, in error
return self._call_chain(args)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
result = func(args)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway
能否增加个出现 HTTP Error 502 的时候,自动重启的功能? ———————————————————————————————————————————— 错误如下: Traceback (most recent call last): File "main.py", line 24, in
book = wqxtDownloader( bid );
File "C:\Users\83669\Desktop\wqxuetang_downloader-master (1)\wqxuetang_downloader-master\wqxtDownloader.py", line 36, in init
self.catatree = self.getCatatree();
File "C:\Users\83669\Desktop\wqxuetang_downloader-master (1)\wqxuetang_downloader-master\wqxtDownloader.py", line 84, in getCatatree
request = curl.request.urlopen(url);
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 569, in error
return self._call_chain(args)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 503, in _call_chain
result = func(args)
File "C:\Users\83669\AppData\Local\Programs\Python\Python37-32\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway