Module: check_mk
Branch: master
Commit: 06ac17e826669558a50d464df03dc7133dacd057
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06ac17e8266695…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jun 24 08:06:33 2016 +0200
Fix displaying of exceptions while in rendering tables
---
web/htdocs/htmllib.py | 7 +++++++
web/htdocs/index.py | 2 ++
2 files changed, 9 insertions(+)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index bea4704..4d96a06 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -226,6 +226,11 @@ class html(GUITester):
self.plugged = True
self.plugged_text = ''
+
+ def is_plugged(self):
+ return self.plugged
+
+
def flush(self):
if self.plugged:
text = self.plugged_text
@@ -239,6 +244,7 @@ class html(GUITester):
self.lowlevel_write(text)
self.plugged_text = ''
+
def drain(self):
if self.plugged:
t = self.plugged_text
@@ -247,6 +253,7 @@ class html(GUITester):
else:
return ''
+
def unplug(self):
self.flush()
self.plugged = False
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 72f8e15..7f38224 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -140,6 +140,8 @@ def handler(req, fields = None, is_profiling = False):
except (MKUserError, MKAuthException, MKUnauthenticatedException, MKConfigError,
MKGeneralException,
livestatus.MKLivestatusNotFoundError, livestatus.MKLivestatusException), e:
+ if html.is_plugged():
+ html.unplug()
ty = type(e)
if ty == livestatus.MKLivestatusNotFoundError:
title = _("Data not found")