Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[JENKINS-43507] re-use Throwable.getMessage()
- Loading branch information
|
@@ -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>"); |
|
|
|
|
|
} |
|
|