|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
gate.util.LuckyException
public class LuckyException
This exception is intended to be used in places where there definitely
shouldn't be any exceptions thrown but the API requires us to catch some,
eg:
try{
if( a != null){
a.doSomething();
}
}catch(NullPointerException npe){
throw new LuckyException("I found a null pointer!");
}
Of course the system will never require you to catch NullPOinterException as
it derives from RuntimeException, but I couldn't come with a better example.
| Field Summary | |
|---|---|
private static boolean |
DEBUG
Debug flag |
(package private) static String |
defaultMessage
The default message carried by this type of exceptions |
| Constructor Summary | |
|---|---|
LuckyException()
Default constructor, creates a new execption with the default message |
|
LuckyException(String message)
Creates a new exception with the provided message prepended to the default one on a separate line. |
|
LuckyException(String message,
Throwable cause)
|
|
LuckyException(Throwable cause)
|
|
| Method Summary |
|---|
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG
static String defaultMessage
| Constructor Detail |
|---|
public LuckyException()
public LuckyException(String message)
message - the uses message
public LuckyException(String message,
Throwable cause)
public LuckyException(Throwable cause)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||