From 1a04a107acce2aefcb5584c8fbf9cd39b3072110 Mon Sep 17 00:00:00 2001 From: nemunaire Date: Thu, 1 Jan 2015 19:57:44 +0100 Subject: [PATCH] web tools: handle no route to host error --- tools/web.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/web.py b/tools/web.py index 576fb4d..ed88010 100644 --- a/tools/web.py +++ b/tools/web.py @@ -92,6 +92,8 @@ def getURLContent(url, timeout=15): conn.request("GET", o.path, None, {"User-agent": "Nemubot v3"}) except socket.timeout: return None + except OSError: # [Errno 113] No route to host + return None except socket.gaierror: print (" Unable to receive page %s on %s from %s." % (o.path, o.netloc, url))