From: hernani Date: Thu, 2 Sep 2010 01:28:10 +0000 (+0000) Subject: Moves the try clause up a bit in the ui renderer to catch possible exceptions before... X-Git-Tag: live~551 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/b9ad70bc652c43fb141313cdfb3256eb22e14e84 Moves the try clause up a bit in the ui renderer to catch possible exceptions before the actual rendering. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@583 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/templatetags/ui_registry.py b/forum/templatetags/ui_registry.py index 1e76972..02d90ea 100644 --- a/forum/templatetags/ui_registry.py +++ b/forum/templatetags/ui_registry.py @@ -15,16 +15,16 @@ class LoadRegistryNode(template.Node): result = '' for ui_object in self.registry: - if ui_object.can_render(context): - try: - if result: - result += separator - result += ui_object.render(context) - except Exception, e: - import traceback - logging.error("Exception %s rendering ui objects %s: \n%s" % ( - e, ui_object, traceback.format_exc() - )) + try: + if ui_object.can_render(context): + if result: + result += separator + result += ui_object.render(context) + except Exception, e: + import traceback + logging.error("Exception %s rendering ui objects %s: \n%s" % ( + e, ui_object, traceback.format_exc() + )) return result