File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\util\AdministrativeError.java.html

1 package hudson.util;
2
3 import hudson.model.AdministrativeMonitor;
4 import hudson.Extension;
5
6 /**
7 * A convenient {@link AdministrativeMonitor} implementations that show an error message
8 * and optional stack trace. This is useful for notifying a non-fatal error to the administrator.
9 *
10 * <p>
11 * These errors are registered when instances are created. No need to use {@link Extension}.
12 *
13 * @author Kohsuke Kawaguchi
14 */
15 public class AdministrativeError extends AdministrativeMonitor {
16 public final String message;
17 public final String title;
18 public final Throwable details;
19
20 /**
21 * @param id
22 * Unique ID that distinguishes this error from other errors.
23 * Must remain the same across Hudson executions. Use a caller class name, or something like that.
24 * @param title
25 * A title of the problem. This is used as the HTML title
26 * of the details page. Should be just one sentence, like "ZFS migration error."
27 * @param message
28 * A short description of the problem. This is used in the "/manage" page, and can include HTML, but it should be still short.
29 * @param details
30 * An exception indicating the problem. The administrator can see this once they click "more details".
31 */
32 public AdministrativeError(String id, String title, String message, Throwable details) {
33 super(id);
34 this.message = message;
35 this.title = title;
36 this.details = details;
37
38 all().add(this);
39 }
40
41 public boolean isActivated() {
42 return true;
43 }
44 }
45