mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] add failure handling mechanism for json decoding
This commit is contained in:
parent
87a5759ca4
commit
fbdf684254
1 changed files with 9 additions and 2 deletions
|
@ -299,8 +299,15 @@ def _migrate_from_md5_tsig_to_sha512_tsig(private_key_path, domain, dyn_host):
|
||||||
|
|
||||||
if r.status_code != 201:
|
if r.status_code != 201:
|
||||||
print r.text
|
print r.text
|
||||||
error = json.loads(r.text)['error']
|
try:
|
||||||
print "ERROR:", error
|
error = json.loads(r.text)['error']
|
||||||
|
print "ERROR:", error
|
||||||
|
except Exception as e:
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
|
print e
|
||||||
|
error = r.text
|
||||||
|
|
||||||
# raise MoulinetteError(errno.EPERM,
|
# raise MoulinetteError(errno.EPERM,
|
||||||
# m18n.n('dyndns_registration_failed', error=error))
|
# m18n.n('dyndns_registration_failed', error=error))
|
||||||
# XXX print warning
|
# XXX print warning
|
||||||
|
|
Loading…
Add table
Reference in a new issue