GateRuntimeException
or
just plain RuntimeException
and one of those should be used instead.@Deprecated public class LuckyException extends RuntimeException
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.Constructor and Description |
---|
LuckyException()
Deprecated.
Default constructor, creates a new execption with the default message
|
LuckyException(String message)
Deprecated.
Creates a new exception with the provided message prepended to the
default one on a separate line.
|
LuckyException(String message,
Throwable cause)
Deprecated.
|
LuckyException(Throwable cause)
Deprecated.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public LuckyException()
public LuckyException(String message)
message
- the uses messagepublic LuckyException(Throwable cause)
Copyright © 2024 GATE. All rights reserved.