diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-13 18:21:14 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-13 18:21:14 +0100 |
commit | 03824b2e45b12409a06be6b89c6fc6ee9d75e0e5 (patch) | |
tree | 78ec076b99d41e54320907d0b8c1baf1d5d68719 | |
parent | Handle exception in change_feed_name(). (diff) | |
download | newspipe-03824b2e45b12409a06be6b89c6fc6ee9d75e0e5.tar.gz newspipe-03824b2e45b12409a06be6b89c6fc6ee9d75e0e5.tar.bz2 newspipe-03824b2e45b12409a06be6b89c6fc6ee9d75e0e5.zip |
Handle exception in change_feed_logo().
-rwxr-xr-x | source/pyAggr3g470r.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 36780da2..e30c82f5 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -568,9 +568,14 @@ class pyAggr3g470r(object): """ Enables to change the name of a feed. """ - self.mongo.update_feed(feed_id, {"feed_image":new_feed_logo}) - tmpl = lookup.get_template("confirmation.html") - return tmpl.render(message="<p>The logo of the feed has been changed.</p>") + try: + self.mongo.update_feed(feed_id, {"feed_image":new_feed_logo}) + tmpl = lookup.get_template("confirmation.html") + message = "<p>The logo of the feed has been changed.</p>" + except: + tmpl = lookup.get_template("error.html") + message = "<p>Error when changing the logo of the feed.</p>" + return tmpl.render(message=message) change_feed_logo.exposed = True |