Skip to content

Commit 6276d22

Browse files
author
phuslu
committed
catch all exception
1 parent a128fca commit 6276d22

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ddns

+5-2
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,11 @@ def _getip(domain):
264264
]
265265
result = Queue()
266266
def _fetch(url):
267-
result.put(urlopen(Request(url, headers={'user-agent':'curl/7.53'}), timeout=5))
268-
logging.info('getip() from %r', url)
267+
try:
268+
result.put(urlopen(Request(url, headers={'user-agent':'curl/7.53'}), timeout=5))
269+
logging.info('getip() from %r', url)
270+
except Exception as e:
271+
logging.exception('getip() from %r error: %s', url, e)
269272
for url in urls:
270273
t = threading.Thread(target=_fetch, args=(url,))
271274
t.setDaemon(True)

0 commit comments

Comments
 (0)