Thomas Waldmann  committed 77d7c15

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)

  • Participants
  • Parent commits d4a382f

Comments (0)

Files changed (2)

File MoinMoin/items/

             # 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):

File MoinMoin/templates/crash.html

-<h1>{{ _("Boom!") }}</h1>
+<h1>{{ _("Oops!") }}</h1>
-    {{ _("An error happened while rendering the data.") }}
+    {{ _("An error happened while processing your request.") }}
-    {{ _("More details are in the server log. Time and URL are helpful for locating the corresponding log entries:") }}
+    {{ _("More details have been logged. The following data is helpful for locating the corresponding log entries:") }}
+    <dt>{{ _("Error ID") }}</dt>
+    <dd>{{ error_id }}</dd>
     <dt>{{ _("Server time") }}</dt>
     <dd>{{ server_time }}</dd>
     <dt>{{ _("URL") }}</dt>