issrg.utils
Class EmbeddedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by issrg.utils.EmbeddedException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ACCreationException, PbaException, RepositoryException, RFC2253ParsingException, SecurityException

public class EmbeddedException
extends java.lang.Exception

This exception object is supposed for use with other exceptions that you do not want to pass to the caller, but still want your caller to get all the debug information possible. You then call getEmbedded() method to get the exception that was the real cause of an error and display all the details out of it.

Version:
1.0
Author:
A Otenko
See Also:
Serialized Form

Constructor Summary
EmbeddedException()
           
EmbeddedException(java.lang.String msg)
           
EmbeddedException(java.lang.String msg, java.lang.Throwable embed)
          This constructor lets you embed another exception or any other throwable in.
 
Method Summary
 java.lang.Throwable getEmbedded()
          This method returns the embedded object, if any.
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream ps)
           
 void printStackTrace(java.io.PrintWriter pw)
           
 
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

EmbeddedException

public EmbeddedException()

EmbeddedException

public EmbeddedException(java.lang.String msg)

EmbeddedException

public EmbeddedException(java.lang.String msg,
                         java.lang.Throwable embed)
This constructor lets you embed another exception or any other throwable in. Now if you catch all Throwables and embed them into this exception, you can guarantee the caller will get nothing but the EmbeddedException. Now the caller can just display your default message, but also can inspect if anything more serious has caused the problem.

See Also:
getEmbedded()
Method Detail

getEmbedded

public java.lang.Throwable getEmbedded()
This method returns the embedded object, if any. It can be null, if no exceptions were embedded, but if it is not null, you could figure out the cause of error more precisely.


printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Overrides:
printStackTrace in class java.lang.Throwable