diff options
author | Rob Crittenden <rcritten@redhat.com> | 2015-03-31 14:23:49 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2015-04-10 10:37:37 -0400 |
commit | fa333f2d94885df6beb3d7ea29380e28fde651a4 (patch) | |
tree | 6659742c184633c0dae08905914c8d7e967370cc /ipsilon/admin/common.py | |
parent | 8ad119e79a510fa465b725570a300e5b3e356751 (diff) | |
download | ipsilon-fa333f2d94885df6beb3d7ea29380e28fde651a4.tar.gz ipsilon-fa333f2d94885df6beb3d7ea29380e28fde651a4.tar.xz ipsilon-fa333f2d94885df6beb3d7ea29380e28fde651a4.zip |
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>
Diffstat (limited to 'ipsilon/admin/common.py')
-rw-r--r-- | ipsilon/admin/common.py | 6 |
1 files changed, 4 insertions, 2 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 |