From 84b8b32866f7270f88b71a2104dd27fcb3d028c0 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sun, 18 Sep 2016 10:43:51 +0200 Subject: [PATCH] When in debug mode, print the lookup name of the column with a template that is throwing an exception. --- src/calibre/utils/formatter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/utils/formatter.py b/src/calibre/utils/formatter.py index 7fa4b1b080..075c34dfa5 100644 --- a/src/calibre/utils/formatter.py +++ b/src/calibre/utils/formatter.py @@ -525,6 +525,8 @@ class TemplateFormatter(string.Formatter): except Exception as e: if DEBUG: # and getattr(e, 'is_locking_error', False): traceback.print_exc() + if column_name: + print('Error evaluating column named: %s' % column_name) ans = error_value + ' ' + e.message return ans