Display exact sign error to UI on failure

This commit is contained in:
shortcutme 2017-06-19 16:11:47 +02:00
parent 43c8dacd70
commit 79ca1069ec
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -377,10 +377,11 @@ class UiWebsocket(object):
# Reload content.json, ignore errors to make it up-to-date
site.content_manager.loadContent(inner_path, add_bad_files=False, force=True)
# Sign using private key sent by user
signed = site.content_manager.sign(inner_path, privatekey, extend=extend, update_changed_files=update_changed_files, remove_missing_optional=remove_missing_optional)
if not signed:
self.cmd("notification", ["error", _["Content signing failed"]])
self.response(to, {"error": "Site sign failed"})
try:
signed = site.content_manager.sign(inner_path, privatekey, extend=extend, update_changed_files=update_changed_files, remove_missing_optional=remove_missing_optional)
except Exception, err:
self.cmd("notification", ["error", _["Content signing failed"] + "<br><small>%s</small>" % err])
self.response(to, {"error": "Site sign failed: %s" % err})
return
site.content_manager.loadContent(inner_path, add_bad_files=False) # Load new content.json, ignore errors