Log failed domain apply operation

This commit is contained in:
Khanh Ngo 2020-06-20 09:51:30 +07:00
parent 5123d542e4
commit 1f4580a27a
No known key found for this signature in database
GPG Key ID: 29077342AA5648F6

View File

@ -439,6 +439,15 @@ def record_apply(domain_name):
history.add()
return make_response(jsonify(result), 200)
else:
history = History(
msg='Failed to apply record changes to domain {0}'.format(domain_name),
detail=str(
json.dumps({
"domain": domain_name,
"msg": result['msg'],
})),
created_by=current_user.username)
history.add()
return make_response(jsonify(result), 400)
except Exception as e:
current_app.logger.error(