Skip to content
Permalink
Browse files

[JENKINS-43507] re-use Throwable.getMessage()

  • Loading branch information...
stephenc committed Jun 19, 2017
1 parent 854aa02 commit ae7a939175d161edf8ac196b3617e9e8d75f4db0
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/main/java/org/jenkinsci/plugins/github_branch_source/FillErrorResponse.java
@@ -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;
}

@@ -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>");

}

0 comments on commit ae7a939

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