comparison MoinMoin/items/content.py @ 1901:77d7c15299c9

error logging: include error uuid in the log, tell user the uuid on the UI (so it is easier to lookup the problem in the log)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 24 Dec 2012 17:44:07 +0100
parents d4a382f781c9
children 78b7a1136984
comparison
equal deleted inserted replaced
1900:d4a382f781c9 1901:77d7c15299c9
244 rendered_data = conv_serialize(doc, {html.namespace: ''}) 244 rendered_data = conv_serialize(doc, {html.namespace: ''})
245 except Exception: 245 except Exception:
246 # we really want to make sure that invalid data or a malfunctioning 246 # we really want to make sure that invalid data or a malfunctioning
247 # converter does not crash the item view (otherwise a user might 247 # converter does not crash the item view (otherwise a user might
248 # not be able to fix it from the UI). 248 # not be able to fix it from the UI).
249 logging.exception("An exception happened in _render_data:") 249 import time, uuid
250 import time 250 error_id = uuid.uuid4()
251 logging.exception("An exception happened in _render_data (error_id = %s ):" % error_id)
251 rendered_data = render_template('crash.html', 252 rendered_data = render_template('crash.html',
252 server_time=time.strftime("%Y-%m-%d %H:%M:%S %Z"), 253 server_time=time.strftime("%Y-%m-%d %H:%M:%S %Z"),
253 url=request.url) 254 url=request.url,
255 error_id=error_id)
254 return rendered_data 256 return rendered_data
255 257
256 def _render_data_xml(self): 258 def _render_data_xml(self):
257 doc = self.internal_representation() 259 doc = self.internal_representation()
258 return conv_serialize(doc, 260 return conv_serialize(doc,