only traceback for unknown errors

This commit is contained in:
j 2016-02-12 14:30:59 +05:30
parent 55a858c410
commit 051db29cb0

View file

@ -11,13 +11,13 @@ import urllib.request, urllib.error, urllib.parse
from datetime import datetime
import os
import time
import socket
import ox
from tornado.ioloop import PeriodicCallback
import settings
import user.models
from changelog import Changelog
from websocket import trigger_event
from localnodes import LocalNodes
@ -297,6 +297,9 @@ class Node(Thread):
self._opener.addheaders = list(zip(self.headers.keys(), self.headers.values()))
try:
r = self._opener.open(url, timeout=self.TIMEOUT*5)
except socket.timeout:
logger.debug('timeout %s', url)
return False
except:
logger.debug('openurl failed %s', url, exc_info=True)
return False