web tools: handle no route to host error
This commit is contained in:
parent
116c81f5b2
commit
1a04a107ac
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue