Skip to content

Commit

Permalink
[JENKINS-21292] Do not attempt to parse blank responses from cancelle…
Browse files Browse the repository at this point in the history
…d XHR POST requests

An XHR POST request may be cancelled by navigating away from the page while the timeline is loading.  This causes alert spam on Chrome and Safari.
(cherry picked from commit 72bb477)
  • Loading branch information
nzmsv authored and olivergondza committed Feb 16, 2014
1 parent 53e2f7e commit 4ea919c
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ THE SOFTWARE.
method:"POST", method:"POST",
parameters: {min: i*interval, max:(i+1)*interval}, parameters: {min: i*interval, max:(i+1)*interval},
onSuccess: function(t) { onSuccess: function(t) {
try { if (t.status != 0) {
eventSource1.loadJSON(eval('('+t.responseText+')'),'.'); try {
} catch (e) { eventSource1.loadJSON(eval('('+t.responseText+')'),'.');
alert(e); } catch (e) {
alert(e);
}
} }
} }
}); });
Expand Down

0 comments on commit 4ea919c

Please sign in to comment.