Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-43507] re-use Throwable.getMessage()
  • Loading branch information
stephenc committed Jun 19, 2017
1 parent 854aa02 commit ae7a939
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -13,11 +13,10 @@
// TODO replace with corresponding core functionality once Jenkins core has JENKINS-42443
class FillErrorResponse extends IOException implements HttpResponse {

private final String message;
private final boolean clearList;

public FillErrorResponse(String message, boolean clearList) {
this.message = message;
super(message);
this.clearList = clearList;
}

Expand All @@ -29,7 +28,7 @@ public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object nod
rsp.setHeader("X-Jenkins-Select-Error", clearList ? "clear" : "retain");
rsp.getWriter().print(
"<div class=\'error\'><img src=\'" + req.getContextPath()
+ Jenkins.RESOURCE_PATH + "/images/none.gif\' height=16 width=1>" + Util.escape(message) +
+ Jenkins.RESOURCE_PATH + "/images/none.gif\' height=16 width=1>" + Util.escape(getMessage()) +
"</div>");

}
Expand Down

0 comments on commit ae7a939

Please sign in to comment.