web tools: handle no route to host error
This commit is contained in:
parent
116c81f5b2
commit
1a04a107ac
@ -92,6 +92,8 @@ def getURLContent(url, timeout=15):
|
|||||||
conn.request("GET", o.path, None, {"User-agent": "Nemubot v3"})
|
conn.request("GET", o.path, None, {"User-agent": "Nemubot v3"})
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
return None
|
return None
|
||||||
|
except OSError: # [Errno 113] No route to host
|
||||||
|
return None
|
||||||
except socket.gaierror:
|
except socket.gaierror:
|
||||||
print ("<tools.web> Unable to receive page %s on %s from %s."
|
print ("<tools.web> Unable to receive page %s on %s from %s."
|
||||||
% (o.path, o.netloc, url))
|
% (o.path, o.netloc, url))
|
||||||
|
Loading…
Reference in New Issue
Block a user