Commit 7619c01f authored by Jérome Perrin's avatar Jérome Perrin

live_test_gadget: Tolerate errors in AJAX requests

For example when zope is restarting
parent d882eac1
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts52669278.59</string> </value>
<value> <string>ts52670931.35</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
......@@ -22,7 +22,7 @@
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global window, rJS, jIO, RSVP, location, document, FormData */\n
/*global window, rJS, jIO, RSVP, location, document, FormData, console */\n
/*jslint indent: 2, maxlen: 80, nomen: true */\n
(function (rJS, jIO, RSVP, window, document, FormData) {\n
"use strict";\n
......@@ -81,6 +81,8 @@
if (!paused) {\n
continue_loop = false;\n
}\n
}, function (error) {\n
console.error("Error launching live tests", error);\n
});\n
}\n
return queue.push(function () {\n
......@@ -92,7 +94,7 @@
function getLiveTestOutput() {\n
queue.push(function () {\n
return jIO.util.ajax({\n
type: "POST",\n
type: "GET",\n
url: my_url_read_test\n
});\n
}).push(function (evt) {\n
......@@ -107,6 +109,8 @@
data_textarea.scrollTop = data_textarea.scrollHeight;\n
}\n
return RSVP.delay(1000);\n
}, function (error) {\n
console.error("Error refreshing live test output", error);\n
}).push(function () {\n
if (continue_loop) {\n
return getLiveTestOutput();\n
......@@ -135,7 +139,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3370</int> </value>
<value> <int>3561</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment