Module: check_mk
Branch: master
Commit: 6de246d08c5daa649926cdcef006e344e8adc202
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6de246d08c5daa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 2 11:25:06 2016 +0100
4083 Web API: Always output full traceback in case of non Check_MK unhandled exceptions
---
.werks/4083 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/webapi.py | 7 ++++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/4083 b/.werks/4083
new file mode 100644
index 0000000..41cb69b
--- /dev/null
+++ b/.werks/4083
@@ -0,0 +1,9 @@
+Title: Web API: Always output full traceback in case of non Check_MK unhandled
exceptions
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i3
+Date: 1480674286
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index b59d44e..eff54ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,7 @@
* 4106 new filter host/service-service-level...
* 4107 Now you are able to search for check plugins
* 3997 New metric for mrpe/check_icmp...
+ * 4083 Web API: Always output full traceback in case of non Check_MK unhandled
exceptions
* 3974 FIX: Sorting comments in hover menu of comments icon by time now
* 4040 FIX: Fix error in view about "No WATO folder ..." in case of host
imported via cmcdump...
* 4046 FIX: Repaired html rendering....
diff --git a/web/htdocs/webapi.py b/web/htdocs/webapi.py
index 7b9fedb..edc437c 100644
--- a/web/htdocs/webapi.py
+++ b/web/htdocs/webapi.py
@@ -24,6 +24,8 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+import traceback
+
from lib import *
import config
@@ -102,7 +104,10 @@ def page_api():
if config.debug:
raise
log_exception()
- response = { "result_code": 1, "result": "%s" % e
}
+ response = {
+ "result_code" : 1,
+ "result" : "Unhandled exception: %s" %
traceback.format_exc(),
+ }
if html.output_format == "json":
html.write(json.dumps(response))