Module: check_mk
Branch: master
Commit: 91d71a174ec1bc19ebd2c975040f197a6e656b58
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91d71a174ec1bc…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Jun 10 08:46:59 2016 +0200
fixed failure to report a crash (happens under unknown circumstances)
---
web/htdocs/crash_reporting.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/crash_reporting.py b/web/htdocs/crash_reporting.py
index 9b2b29c..5b7aa24 100644
--- a/web/htdocs/crash_reporting.py
+++ b/web/htdocs/crash_reporting.py
@@ -393,8 +393,13 @@ def show_agent_output(tardata):
def get_local_vars_of_last_exception():
local_vars = {}
- for key, val in inspect.trace()[-1][0].f_locals.items():
- local_vars[key] = format_var_for_export(val)
+ try:
+ for key, val in inspect.trace()[-1][0].f_locals.items():
+ local_vars[key] = format_var_for_export(val)
+ except IndexError:
+ # please don't crash in the attempt to report a crash.
+ # Don't know why inspect.trace() causes an IndexError but it does happen
+ pass
# This needs to be encoded as the local vars might contain binary data which can not
be
# transported using JSON.