hudson.model.Run.sendError()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中hudson.model.Run.sendError方法的一些代码示例,展示了Run.sendError的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Run.sendError方法的具体详情如下:
包路径:hudson.model.Run
类名称:Run
方法名:sendError

Run.sendError介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * Deletes the build when the button is pressed.
 */
@RequirePOST
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(getFullDisplayName(), why), req, rsp);
    return;
  }
  try{
    delete();
  }
  catch(IOException ex){
    req.setAttribute("stackTraces", Functions.printThrowable(ex));
    req.getView(this, "delete-retry.jelly").forward(req, rsp);  
    return;
  }
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(toString(),why),req,rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Deletes the build when the button is pressed.
 */
@RequirePOST
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(getFullDisplayName(), why), req, rsp);
    return;
  }
  try{
    delete();
  }
  catch(IOException ex){
    req.setAttribute("stackTraces", Functions.printThrowable(ex));
    req.getView(this, "delete-retry.jelly").forward(req, rsp);  
    return;
  }
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(toString(),why),req,rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why != null) {
    sendError(Messages.Run_UnableToDelete(toString(), why), req, rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl());
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Deletes the build when the button is pressed.
 */
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
  requirePOST();
  checkPermission(DELETE);
  // We should not simply delete the build if it has been explicitly
  // marked to be preserved, or if the build should not be deleted
  // due to dependencies!
  String why = getWhyKeepLog();
  if (why!=null) {
    sendError(Messages.Run_UnableToDelete(toString(),why),req,rsp);
    return;
  }
  delete();
  rsp.sendRedirect2(req.getContextPath()+'/' + getParent().getUrl());
}

相关文章

微信公众号

最新文章

更多

Run类方法