• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

修訂aa3b05da5b0e281b5116ad4c73aa76ac3a81fa13 (tree)
時間2012-03-15 07:00:58
作者Dave Brondsema <dbrondsema@geek...>
CommiterDave Brondsema

Log Message

[#3895] tighter error handling and less scary message, for notification templates

Signed-off-by: Dave Brondsema <dbrondsema@geek.net>

Change Summary

差異

--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -156,11 +156,13 @@ class Notification(MappedClass):
156156 ''' Add addional text to the notification e-mail based on the artifact type '''
157157 template = cls.view.get_template('mail/' + artifact.type_s + '.txt')
158158 d['text'] += template.render(dict(c=c, g=g, config=config, data=artifact))
159- except Exception, e:
159+ except jinja2.TemplateNotFound:
160+ pass
161+ except:
160162 ''' Catch any errors loading or rendering the template,
161163 but the notification still gets sent if there is an error
162164 '''
163- log.debug('Error rendering notification template %s: %s' % (artifact.type_s, e))
165+ log.warn('Could not render notification template %s' % artifact.type_s, exc_info=True)
164166
165167 assert d['reply_to_address'] is not None
166168 project = Project.query.get(_id=d.get('project_id', c.project._id))