summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2015-03-31 14:23:49 -0400
committerSimo Sorce <simo@redhat.com>2015-04-10 10:37:37 -0400
commitfa333f2d94885df6beb3d7ea29380e28fde651a4 (patch)
tree6659742c184633c0dae08905914c8d7e967370cc
parent8ad119e79a510fa465b725570a300e5b3e356751 (diff)
downloadipsilon-fa333f2d94885df6beb3d7ea29380e28fde651a4.zip
ipsilon-fa333f2d94885df6beb3d7ea29380e28fde651a4.tar.gz
ipsilon-fa333f2d94885df6beb3d7ea29380e28fde651a4.tar.xz
Print exceptions when saving data fails in admin UI
There were places where a broad exception was caught when saving administrative changes but the actual exception wasn't logged. The user was presented only with a 'Failed to save data!' message. https://fedorahosted.org/ipsilon/ticket/39 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
-rw-r--r--ipsilon/admin/common.py6
-rw-r--r--ipsilon/providers/saml2/admin.py3
2 files changed, 6 insertions, 3 deletions
diff --git a/ipsilon/admin/common.py b/ipsilon/admin/common.py
index b371fe9..fe92793 100644
--- a/ipsilon/admin/common.py
+++ b/ipsilon/admin/common.py
@@ -262,7 +262,8 @@ class AdminPluginConfig(AdminPage):
self._po.save_plugin_config(new_db_values)
message = "New configuration saved."
message_type = ADMIN_STATUS_OK
- except Exception: # pylint: disable=broad-except
+ except Exception as e: # pylint: disable=broad-except
+ self.error('Failed to save data: %s' % e)
message = "Failed to save data!"
message_type = ADMIN_STATUS_ERROR
@@ -334,7 +335,8 @@ class AdminPluginsOrder(AdminPage):
message = str(e)
message_type = ADMIN_STATUS_ERROR
- except Exception, e: # pylint: disable=broad-except
+ except Exception as e: # pylint: disable=broad-except
+ self.error('Failed to save data: %s' % e)
message = "Failed to save data!"
message_type = ADMIN_STATUS_ERROR
diff --git a/ipsilon/providers/saml2/admin.py b/ipsilon/providers/saml2/admin.py
index 2503be1..d5a5bdf 100644
--- a/ipsilon/providers/saml2/admin.py
+++ b/ipsilon/providers/saml2/admin.py
@@ -255,7 +255,8 @@ class SPAdminPage(AdminPage):
self.parent.rename_sp(rename[0], rename[1])
message = "Properties successfully changed"
message_type = ADMIN_STATUS_OK
- except Exception: # pylint: disable=broad-except
+ except Exception, e: # pylint: disable=broad-except
+ self.error('Failed to save data: %s' % e)
message = "Failed to save data!"
message_type = ADMIN_STATUS_ERROR