diff --git a/core/src/main/resources/jenkins/model/Jenkins/oops.jelly b/core/src/main/resources/jenkins/model/Jenkins/oops.jelly
index 2a7e0910d2b879a48b8201e67e4e9daa2ad02f6d..5380997667dc836cd2360da75ef3b38d7a619c75 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 35c7433ad04aac02a1d88f0478ade9a139cfefcc..be6ddf57ac46bd6b8957d96a13b3bc23d8ffccfb 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");