|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception issrg.utils.EmbeddedException issrg.pba.PbaException
public class PbaException
This is an exception to be thrown by PBA API implementations in cases of need. It contains the real cause of the error, in case the error has been caused by some other objects used by the implementation.
Example:
try{
Note that the code above will throw only PbaExceptions. All other errors
are caught and embedded. This allows the caller of the code to catch
PbaExceptions only, and be sure nothing else will happen. The simplest
error handler will just display an error, a sophisticated error handler
can still extract the real cause of the error and do something cleverer.
...
}catch(PbaException pba){
throw pba;
}catch(Throwable th){
throw new PbaException("Internal error", th);
}
Constructor Summary | |
---|---|
PbaException()
The default constructor builds an exception with no explanation message and no embedded exception. |
|
PbaException(java.lang.String msg)
This constructor builds an exception with a message but no embedded exception. |
|
PbaException(java.lang.String msg,
java.lang.Throwable th)
This constructor builds an exception with a message and an embedded exception to be returned by getEmbedded method. |
Method Summary |
---|
Methods inherited from class issrg.utils.EmbeddedException |
---|
getEmbedded, printStackTrace, printStackTrace, printStackTrace |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PbaException()
public PbaException(java.lang.String msg)
msg
- is the String message explaining the error; can be nullpublic PbaException(java.lang.String msg, java.lang.Throwable th)
msg
- is the String explanation of the error; can be nullth
- is the Throwable object to be believed the cause of
the error; can be null, if there is no embedded exceptionEmbeddedException.getEmbedded()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |