diff 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
line wrap: on
line diff
--- a/MoinMoin/items/content.py	Mon Dec 24 03:45:30 2012 +0100
+++ b/MoinMoin/items/content.py	Mon Dec 24 17:44:07 2012 +0100
@@ -246,11 +246,13 @@
             # we really want to make sure that invalid data or a malfunctioning
             # converter does not crash the item view (otherwise a user might
             # not be able to fix it from the UI).
-            logging.exception("An exception happened in _render_data:")
-            import time
+            import time, uuid
+            error_id = uuid.uuid4()
+            logging.exception("An exception happened in _render_data (error_id = %s ):" % error_id)
             rendered_data = render_template('crash.html',
                                             server_time=time.strftime("%Y-%m-%d %H:%M:%S %Z"),
-                                            url=request.url)
+                                            url=request.url,
+                                            error_id=error_id)
         return rendered_data
 
     def _render_data_xml(self):