X-Git-Url: https://git.ralfj.de/dyn-nsupdate.git/blobdiff_plain/7c4ac38811ab6a4afae9316433503a60103c865e..2ded2634bd090dacf54effe51566cd3ab8c3aeaa:/client-scripts/dyn-ns-client?ds=inline diff --git a/client-scripts/dyn-ns-client b/client-scripts/dyn-ns-client index 175d880..0e96bed 100755 --- 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']) - 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