KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > exception > Bug


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.exception;
25
26
27 /**
28  * <p>Thrown to indicate that something completely unexpected has happen.
29  * If you ever feel the urge to say "ah, this could never happen, I'll skip testing...",
30  * you should probably add the test and throw a Bug if the test fails...</p>
31  * <p>This is an internal error so there is no need to localize the error message.</p>
32  *
33  * @author <a HREF="mailto:meat_for_the_butcher@yahoo.com">Patrik Nyborg</a>
34  */

35 public class Bug extends Error JavaDoc {
36   // --- [Constants] -----------------------------------------------------------
37
// --- [Attributes] ----------------------------------------------------------
38

39   // The throwable that caused this Bug to get thrown (null is permitted).
40
private Throwable JavaDoc cause;
41
42
43
44   // --- [Static] --------------------------------------------------------------
45
// --- [Constructors] --------------------------------------------------------
46

47   /**
48    * Construct a Bug with the detailed error message.
49    *
50    * @param message the detailed error message.
51    */

52   public Bug(String JavaDoc message) {
53     super(message);
54   }
55
56   /**
57    * Construct a Bug with the detailed error message and cause.
58    *
59    * @param message the detailed error message.
60    * @param cause the throwable that caused this Bug to get thrown.
61    */

62   public Bug(String JavaDoc message, Throwable JavaDoc cause) {
63     this(message);
64     this.cause = cause;
65   }
66
67
68
69   // --- [Public] --------------------------------------------------------------
70

71   /**
72    * Returns the cause of this Bug or null if the cause is nonexistent or unknown.
73    * (The cause is the throwable that caused this ConfigurationError to get thrown).
74    *
75    * @return the cause of this Bug or null if the cause is nonexistent or unknown.
76    */

77   public Throwable JavaDoc getCause() {
78     return this.cause;
79   }
80
81
82
83   // --- [X implementation] ----------------------------------------------------
84
// --- [X Overrides] ---------------------------------------------------------
85
// --- [Package protected] ---------------------------------------------------
86
// --- [Private] -------------------------------------------------------------
87
// --- [Protected] -----------------------------------------------------------
88
// --- [Inner classes] -------------------------------------------------------
89
}
Popular Tags