Skip to content
Permalink
Browse files

[JENKINS-21292] Do not attempt to parse blank responses from cancelle…

…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 4ea919c5bb138cab00c70eed6be33f6337e08bfa
Showing with 6 additions and 4 deletions.
  1. +6 −4 core/src/main/resources/hudson/model/BuildTimelineWidget/control.jelly
@@ -59,10 +59,12 @@ THE SOFTWARE.
method:"POST",
parameters: {min: i*interval, max:(i+1)*interval},
onSuccess: function(t) {
try {
eventSource1.loadJSON(eval('('+t.responseText+')'),'.');
} catch (e) {
alert(e);
if (t.status != 0) {
try {
eventSource1.loadJSON(eval('('+t.responseText+')'),'.');
} catch (e) {
alert(e);
}
}
}
});

0 comments on commit 4ea919c

Please sign in to comment.