提交 c589aaf8 编写于 作者: K kohsuke

format the JSONException in a <PRE> tag

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15943 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f9d951e9
......@@ -57,6 +57,17 @@ public abstract class AbstractModelObject implements SearchableModelObject {
rsp.forward(this,"error",req);
}
/**
* @param pre
* If true, the message is put in a PRE tag.
*/
protected final void sendError(String message, StaplerRequest req, StaplerResponse rsp, boolean pre) throws ServletException, IOException {
req.setAttribute("message",message);
if(pre)
req.setAttribute("pre",true);
rsp.forward(this,"error",req);
}
protected final void sendError(String message) throws ServletException, IOException {
sendError(message,Stapler.getCurrentRequest(),Stapler.getCurrentResponse());
}
......
......@@ -946,7 +946,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
e.printStackTrace(pw);
rsp.setStatus(SC_BAD_REQUEST);
sendError(sw.toString(), req, rsp);
sendError(sw.toString(), req, rsp, true);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册