提交 68b383e0 编写于 作者: K Kohsuke Kawaguchi

Adding another cause

上级 2e87c36c
......@@ -70,7 +70,7 @@ public abstract class CauseOfInterruption implements Serializable {
}
/**
* Indicates that the build was interrupted from UI.
* Indicates that the build was interrupted from UI by an user.
*/
public static final class UserInterruption extends CauseOfInterruption {
private final String user;
......@@ -112,5 +112,32 @@ public abstract class CauseOfInterruption implements Serializable {
private static final long serialVersionUID = 1L;
}
/**
* Indicates that the build was interrupted as a result of another a problem.
*
* <p>
* This is a less specific (thus less desirable) {@link CauseOfInterruption}
* in case there's no suitable {@link CauseOfInterruption}. Use sparingly.
*/
class ExceptionInterruption extends CauseOfInterruption {
private final Throwable cause;
public ExceptionInterruption(Throwable cause) {
this.cause = cause;
}
public Throwable getCause() {
return cause;
}
@Override
public String getShortDescription() {
return "Exception: "+ cause.getMessage();
}
private static final long serialVersionUID = 1L;
}
private static final long serialVersionUID = 1L;
}
package jenkins.model.CauseOfInterruption.ExceptionInterruption
import hudson.util.FormValidation;
raw(FormValidation.error(my.cause, my.cause.message).renderHtml());
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册