mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] unreferenced exceptions
This commit is contained in:
parent
21b67ee7d0
commit
2d88ab9a24
1 changed files with 2 additions and 2 deletions
|
@ -96,7 +96,7 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None
|
|||
# Send subscription
|
||||
try:
|
||||
r = requests.post('https://%s/key/%s' % (subscribe_host, base64.b64encode(key)), data={ 'subdomain': domain })
|
||||
except ConnectionError:
|
||||
except requests.ConnectionError:
|
||||
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
|
||||
if r.status_code != 201:
|
||||
try: error = json.loads(r.text)['error']
|
||||
|
@ -129,7 +129,7 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non
|
|||
if ip is None:
|
||||
try:
|
||||
new_ip = requests.get('http://ip.yunohost.org').text
|
||||
except ConnectionError:
|
||||
except requests.ConnectionError:
|
||||
raise MoulinetteError(errno.ENETUNREACH, m18n.n('no_internet_connection'))
|
||||
else:
|
||||
new_ip = ip
|
||||
|
|
Loading…
Add table
Reference in a new issue