Skip to content
Permalink
Browse files

When a server error is caught by applyErrorMessage (“ERROR” link), do…

… not render the whole oops.jelly page.

Just pick out the <div id="error-description"> from JENKINS-20772.
  • Loading branch information
jglick committed Oct 14, 2014
1 parent eaf7a26 commit 9620057a58dc07b52752683a433e200f36d4317d
Showing with 16 additions and 5 deletions.
  1. +16 −5 war/src/main/webapp/scripts/hudson-behavior.js
@@ -2202,11 +2202,22 @@ function validateButton(checkUrl,paramList,button) {
}

function applyErrorMessage(elt, rsp) {
var i;
elt.innerHTML = rsp.status==200 ? rsp.responseText
: '<a href="" onclick="document.getElementById(\'valerr' + (i=iota++)
+ '\').style.display=\'block\';return false">ERROR</a><div id="valerr'
+ i + '" style="display:none">' + rsp.responseText + '</div>';
if (rsp.status == 200) {
elt.innerHTML = rsp.responseText;
} else {
var id = 'valerr' + (iota++);
elt.innerHTML = '<a href="" onclick="document.getElementById(\'' + id
+ '\').style.display=\'block\';return false">ERROR</a><div id="'
+ id + '" style="display:none">' + rsp.responseText + '</div>';
var error = document.getElementById('error-description'); // cf. oops.jelly
if (error) {
var div = document.getElementById(id);
while (div.firstChild) {
div.removeChild(div.firstChild);
}
div.appendChild(error);
}
}
Behaviour.applySubtree(elt);
}

0 comments on commit 9620057

Please sign in to comment.
You can’t perform that action at this time.