FileDocCategorySizeDatePackage
ChainedException.javaAPI DocJBoss 4.2.12051Fri Jul 13 20:56:00 BST 2007xpetstore.util

ChainedException

public class ChainedException extends Exception
Use this class to support chained exceptions in jdk1.3
author
Isabelle Therrien

Fields Summary
private Throwable
cause
Constructors Summary
public ChainedException()


    //~ Constructors -----------------------------------------------------------

       
    
        super(  );
    
public ChainedException(String message)

        super( message );
    
public ChainedException(String message, Throwable cause)

        super( message );
        this.cause = cause;
    
public ChainedException(Throwable cause)

        super( "no message" );
        this.cause = cause;
    
Methods Summary
public java.lang.ThrowablegetCause()

        return cause;
    
public voidprintStackTrace()

        super.printStackTrace(  );

        if ( cause != null )
        {
            System.err.println( "<---- Caused by:" );
            cause.printStackTrace(  );
            System.err.println( "---->" );
        }
    
public voidprintStackTrace(java.io.PrintStream ps)

        super.printStackTrace( ps );

        if ( cause != null )
        {
            ps.println( "<---- Caused by:" );
            cause.printStackTrace( ps );
            ps.println( "---->" );
        }
    
public voidprintStackTrace(java.io.PrintWriter pw)

        super.printStackTrace( pw );

        if ( cause != null )
        {
            pw.println( "<---- Caused by:" );
            cause.printStackTrace( pw );
            pw.println( "---->" );
        }
    
public java.lang.StringtoString()

        if ( cause == null )
        {
            return super.toString(  );
        }
        else
        {
            return super.toString(  ) + "  <---- Caused by: " + cause.toString(  ) + " ---->";
        }