diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops.jelly b/core/src/main/resources/jenkins/model/Jenkins/oops.jelly index 2a7e0910d2b8..5380997667dc 100644 --- a/core/src/main/resources/jenkins/model/Jenkins/oops.jelly +++ b/core/src/main/resources/jenkins/model/Jenkins/oops.jelly @@ -41,6 +41,7 @@ THE SOFTWARE.

${%Oops!}

+

${%problemHappened} ${%checkJIRA} @@ -51,6 +52,7 @@ THE SOFTWARE.

${%Stack trace}

${h.printThrowable(request.getAttribute('javax.servlet.error.exception'))}
+
\ No newline at end of file diff --git a/core/src/main/resources/lib/form/apply/apply.js b/core/src/main/resources/lib/form/apply/apply.js index 35c7433ad04a..be6ddf57ac46 100644 --- a/core/src/main/resources/lib/form/apply/apply.js +++ b/core/src/main/resources/lib/form/apply/apply.js @@ -12,7 +12,7 @@ Behaviour.specify("INPUT.apply-button", 'apply', 0, function (e) { }); responseDialog.setHeader("Error"); - responseDialog.setBody("
"); + responseDialog.setBody("
"); responseDialog.render(document.body); var target; // iframe @@ -42,7 +42,12 @@ Behaviour.specify("INPUT.apply-button", 'apply', 0, function (e) { } else { // otherwise this is possibly an error from the server, so we need to render the whole content. var doc = target.contentDocument || target.contentWindow.document; - $(containerId).appendChild(doc.getElementsByTagName('body')[0]); + var error = doc.getElementById('error-description'); + if (!error) { + // fallback if it's not a regular error dialog from oops.jelly: use the entire body + error = doc.getElementsByTagName('body')[0]; + } + $(containerId).appendChild(error); var r = YAHOO.util.Dom.getClientRegion(); responseDialog.cfg.setProperty("width",r.width*3/4+"px"); responseDialog.cfg.setProperty("height",r.height*3/4+"px");