projects
/
dyn-nsupdate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7c4ac38
)
try to get nicer exception messages when we fail fetching the checkip URL
author
Ralf Jung
<post@ralfj.de>
Tue, 26 Jan 2016 13:13:42 +0000
(14:13 +0100)
committer
Ralf Jung
<post@ralfj.de>
Tue, 26 Jan 2016 13:13:42 +0000
(14:13 +0100)
client-scripts/dyn-ns-client
patch
|
blob
|
history
diff --git
a/client-scripts/dyn-ns-client
b/client-scripts/dyn-ns-client
index 175d88024259ac9702b27a473f05900de0ca0ed3..0e96bedb792e34cb79c35164eb240ebb7a94949a 100755
(executable)
--- a/
client-scripts/dyn-ns-client
+++ b/
client-scripts/dyn-ns-client
@@
-63,7
+63,11
@@
def getMyIP(family, config, methods = {}, verbose = 0):
return None
elif method == 'web':
server = config[family].get('server', config['DEFAULT']['server'])
return None
elif method == 'web':
server = config[family].get('server', config['DEFAULT']['server'])
- ip = urlopen('https://'+server+'/checkip', config)
+ url = 'https://'+server+'/checkip'
+ try:
+ ip = urlopen(url, config)
+ except urllib.error.URLError:
+ raise Exception("Error fetching {}, make sure the URL is correct and the internet connection actually works.".format(url))
if verbose >= VERBOSE_FULL:
print("Server",server,"says my",family,"is",ip)
return ip
if verbose >= VERBOSE_FULL:
print("Server",server,"says my",family,"is",ip)
return ip