changeset 5230:abfb77c0dea9

log page name for macro errors
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 28 Oct 2009 22:01:17 +0100
parents eb786205dbdd
children a94fb46ff128
files MoinMoin/macro/__init__.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/__init__.py	Wed Oct 28 21:27:26 2009 +0100
+++ b/MoinMoin/macro/__init__.py	Wed Oct 28 22:01:17 2009 +0100
@@ -127,7 +127,11 @@
             # and makes the wiki UI unusable (by emitting a Server Error),
             # thus, in case of exceptions, we just log the problem and return
             # some standard text.
-            logging.exception("Macro %s raised an exception:" % self.name)
+            try:
+                page_spec = " (page: '%s')" % self.formatter.page.page_name
+            except:
+                page_spec = ""
+            logging.exception("Macro %s%s raised an exception:" % (self.name, page_spec))
             _ = self.request.getText
             return self.formatter.text(_('<<%(macro_name)s: execution failed [%(error_msg)s] (see also the log)>>') % {
                    'macro_name': self.name,