Module: check_mk
Branch: master
Commit: 3e61e1493a1be00c442e638138a171ce9726a153
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e61e1493a1be0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jun 16 20:27:49 2017 +0200
Log more details to web.log in case of painter exceptions
Change-Id: Ibd70627fcaf4617f819a8aff88f716d79e62e911
---
web/htdocs/lib.py | 6 ++++--
web/htdocs/views.py | 8 +++++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/lib.py b/web/htdocs/lib.py
index 3a702c0..2dd0f55 100644
--- a/web/htdocs/lib.py
+++ b/web/htdocs/lib.py
@@ -288,8 +288,10 @@ def format_plugin_output(output, row = None):
return output
-def log_exception():
- logger.error("%s %s: %s" % (html.request_uri(), _('Internal
error'), traceback.format_exc()))
+def log_exception(msg=None):
+ if msg is None:
+ msg = _('Internal error')
+ logger.error("%s %s: %s" % (html.request_uri(), msg,
traceback.format_exc()))
# Escape/strip unwanted chars from (user provided) strings to
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index f2792bb..ffffe3e 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -747,7 +747,13 @@ class Cell(object):
def render(self, row):
row = join_row(row, self)
- tdclass, content = self.render_content(row)
+
+ try:
+ tdclass, content = self.render_content(row)
+ except:
+ log_exception("Failed to render painter '%s' (Row: %r)" %
+ (self._painter_name, row))
+ raise
if tdclass == None:
tdclass = ""