From f0450ea70340e97dd69fa0b0f3ddfa7c4fc5e133 Mon Sep 17 00:00:00 2001 From: Gregory Eremin Date: Sun, 10 Jan 2016 17:29:47 +0300 Subject: [PATCH] Catch http error if server is not responding --- dashboard/js/http.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dashboard/js/http.js b/dashboard/js/http.js index b3917b9..9acc202 100644 --- a/dashboard/js/http.js +++ b/dashboard/js/http.js @@ -39,5 +39,10 @@ function getURL(url, params, callback) { } } }; - xhr.send(null); + + try { + xhr.send(null); + } catch (e) { + callback({error: e}); + } }