no traceback for proxy error
This commit is contained in:
parent
22099d4b9a
commit
fcb069c7de
1 changed files with 10 additions and 0 deletions
10
oml/nodes.py
10
oml/nodes.py
|
@ -12,6 +12,7 @@ from datetime import datetime
|
|||
import os
|
||||
import time
|
||||
import socket
|
||||
import socks
|
||||
|
||||
import ox
|
||||
from tornado.ioloop import PeriodicCallback
|
||||
|
@ -300,6 +301,9 @@ class Node(Thread):
|
|||
except socket.timeout:
|
||||
logger.debug('timeout %s', url)
|
||||
return False
|
||||
except socks.GeneralProxyError:
|
||||
logger.debug('openurl failed %s', url)
|
||||
return False
|
||||
except:
|
||||
logger.debug('openurl failed %s', url, exc_info=True)
|
||||
return False
|
||||
|
@ -357,6 +361,12 @@ class Node(Thread):
|
|||
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
|
||||
try:
|
||||
r = self._opener.open(url, timeout=self.TIMEOUT*2)
|
||||
except socket.timeout:
|
||||
logger.debug('timeout %s', url)
|
||||
return False
|
||||
except socks.GeneralProxyError:
|
||||
logger.debug('download failed %s', url)
|
||||
return False
|
||||
except:
|
||||
logger.debug('download failed %s', url, exc_info=True)
|
||||
self.online = False
|
||||
|
|
Loading…
Reference in a new issue