summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-11-22 12:56:12 +0100
committerAzul <azul@riseup.net>2012-11-22 12:56:12 +0100
commit61ab6195768e78f1378caca7ca8ef4e7adcaebb3 (patch)
tree8c70102c747b6d96976d2bdaa7aa1bc26fdbd791
parentac5e8d8aa7d4a69a20e20d3079691d13ed2faa66 (diff)
catch empty responses
-rw-r--r--src/jqueryRest.js5
1 files changed, 4 insertions, 1 deletions
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 {