Module: check_mk
Branch: master
Commit: 47aa2e3c60f605bab16b8b04d90cd387b8d0a520
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=47aa2e3c60f605…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Aug 9 11:50:34 2012 +0200
Catch error in get_url_sync function
---
web/htdocs/js/checkmk.js | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index e7e63d8..1a37e37 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -161,9 +161,14 @@ function get_url_sync(url) {
var AJAX = new ActiveXObject("Microsoft.XMLHTTP");
}
- AJAX.open("GET", url, false);
- AJAX.send(null);
- return AJAX.responseText;
+ try
+ {
+ AJAX.open("GET", url, false);
+ AJAX.send(null);
+ return AJAX.responseText;
+ } catch(err) {
+ return false;
+ }
}