From 61ab6195768e78f1378caca7ca8ef4e7adcaebb3 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 22 Nov 2012 12:56:12 +0100 Subject: catch empty responses --- src/jqueryRest.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jqueryRest.js b/src/jqueryRest.js index 20692e9..bc3bb51 100644 --- a/src/jqueryRest.js +++ b/src/jqueryRest.js @@ -70,7 +70,10 @@ srp.remote = (function(){ // the http error response. function error(xhr, text, thrown) { - srp.error($.parseJSON(xhr.responseText)) + if (xhr.responseText && xhr.responseText != "") + srp.error($.parseJSON(xhr.responseText)); + else + srp.error("Server did not respond."); }; return { -- cgit v1.2.3