url_host = split_results.hostname
if url_host in self.proxy_error:
- return 'proxy error', None, None, None, None
+ return 'see prev. error', None, None, None, None
if accept_charset and bookmark.charset:
headers = request_headers.copy()
else:
error, r = request_get(url, headers, self.timeout, None)
if error is not None:
- self.log(' Error: %s' % error)
- if self.proxy:
+ self.log(' Error : %s' % error)
+ if self.proxy and error != '404 not_found':
self.log(' Retrying with the proxy...')
error, r = request_get(url, headers,
self.timeout, self.proxy)
if error is None:
self.proxy_ok.add(url_host)
if error is not None:
- if self.proxy:
- self.log(' Proxy error: %s' % error)
+ if self.proxy and error != '404 not_found':
+ self.log(' Proxy error : %s' % error)
if url_host not in self.proxy_ok:
self.proxy_error.add(url_host)
return error, None, None, None, None
except requests.RequestException as e:
return str(e), None
else:
+ if r.status_code >= 400:
+ error = requests.status_codes._codes[r.status_code][0]
+ return '%d %s' % (r.status_code, error), None
return None, r