From f135ace61d394b38b810b3f26816028eca96be70 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Wed, 13 Mar 2013 18:19:07 +0100 Subject: Handle exception in change_feed_name(). --- source/pyAggr3g470r.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index 5f967cbc..36780da2 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -552,9 +552,14 @@ class pyAggr3g470r(object): """ Enables to change the name of a feed. """ - self.mongo.update_feed(feed_id, {"feed_title":new_feed_name}) - tmpl = lookup.get_template("confirmation.html") - return tmpl.render(message="

The name of the feed has been changed.

") + try: + self.mongo.update_feed(feed_id, {"feed_title":new_feed_name}) + tmpl = lookup.get_template("confirmation.html") + message = "

The name of the feed has been changed.

" + except: + tmpl = lookup.get_template("error.html") + message = "

Error when changing the nameL of the feed.

" + return tmpl.render(message=message) change_feed_name.exposed = True -- cgit