changeset 781:33bfaf10d752 pytest2

better error message for conversion exceptions, including item name and revno, fixes #52
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 27 Aug 2011 21:31:33 +0200
parents f5e0f85e66ce
children 5c60754f8d1a
files MoinMoin/converter/__init__.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/__init__.py	Sat Aug 27 19:11:21 2011 +0200
+++ b/MoinMoin/converter/__init__.py	Sat Aug 27 21:31:33 2011 +0200
@@ -79,7 +79,7 @@
 
 from ..util.mime import Type, type_moin_document
 
-from MoinMoin.config import CONTENTTYPE
+from MoinMoin.config import NAME, CONTENTTYPE
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -123,7 +123,7 @@
         # no way
         raise TypeError("No converter for %s --> %s" % (input_contenttype, output_contenttype))
     except Exception as e: # catch all exceptions, we don't want to break an indexing run
-        logging.exception("Exception happened in conversion:")
+        logging.exception("Exception happened in conversion of item %r rev %d contenttype %s:" % (rev[NAME], rev.revno, rev[CONTENTTYPE]))
         doc = u'ERROR [%s]' % str(e)
         return doc