org.apache.torque
Class TorqueRuntimeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.apache.torque.TorqueRuntimeException
All Implemented Interfaces:
java.io.Serializable

public class TorqueRuntimeException
extends java.lang.RuntimeException

This is a base class of runtime exeptions thrown by Torque.

This class represents a non-checked type exception (see RuntimeException). It is intended to ease the debugging by carrying on the information about the exception which was caught and provoked throwing the current exception. Catching and rethrowing may occur multiple times, and provided that all exceptions except the first one are descendands of TorqueRuntimeException, when the exception is finally printed out using any of the printStackTrace() methods, the stacktrace will contain the information about all exceptions thrown and caught on the way.

Version:
$Id: TorqueRuntimeException.java,v 1.7 2002/09/13 06:09:09 mpoeschl Exp $
Author:
Rafal Krzewski
See Also:
Serialized Form

Field Summary
private  java.lang.Throwable nested
          Holds the reference to the exception or error that caused this exception to be thrown.
 
Fields inherited from class java.lang.RuntimeException
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
TorqueRuntimeException()
          Constructs a new TorqueRuntimeException without specified detail message.
TorqueRuntimeException(java.lang.String msg)
          Constructs a new TorqueRuntimeException with specified detail message.
TorqueRuntimeException(java.lang.String msg, java.lang.Throwable nested)
          Constructs a new TorqueRuntimeException with specified detail message and nested Throwable.
TorqueRuntimeException(java.lang.Throwable nested)
          Constructs a new TorqueRuntimeException with specified nested Throwable.
 
Method Summary
private  java.lang.String[] captureStackTrace()
          Captures the stack trace associated with this exception.
private  java.lang.String[] captureStackTrace(java.lang.Throwable t)
          Captures the stack trace associated with a Throwable object.
 void printStackTrace()
          Prints the stack trace of this exception the the standar error stream.
 void printStackTrace(java.io.PrintStream out)
          Prints the stack trace of this exception to the specified print stream.
 void printStackTrace(java.io.PrintWriter out)
          Prints the stack trace of this exception to the specified print writer.
 void printStackTrace(java.io.PrintWriter out, int skip)
          Prints the stack trace of this exception skiping a specified number of stack frames.
private  java.lang.String[] splitStackTrace(java.lang.String stackTrace)
          Splits the stack trace given as a newline separated string into an array of stack frames.
 
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
 

Field Detail

nested

private java.lang.Throwable nested
Holds the reference to the exception or error that caused this exception to be thrown.

Constructor Detail

TorqueRuntimeException

public TorqueRuntimeException()
Constructs a new TorqueRuntimeException without specified detail message.


TorqueRuntimeException

public TorqueRuntimeException(java.lang.String msg)
Constructs a new TorqueRuntimeException with specified detail message.

Parameters:
msg - the error message.

TorqueRuntimeException

public TorqueRuntimeException(java.lang.Throwable nested)
Constructs a new TorqueRuntimeException with specified nested Throwable.

Parameters:
nested - the exception or error that caused this exception to be thrown.

TorqueRuntimeException

public TorqueRuntimeException(java.lang.String msg,
                              java.lang.Throwable nested)
Constructs a new TorqueRuntimeException with specified detail message and nested Throwable.

Parameters:
msg - the error message.
nested - the exception or error that caused this exception to be thrown.
Method Detail

printStackTrace

public void printStackTrace()
Prints the stack trace of this exception the the standar error stream.


printStackTrace

public void printStackTrace(java.io.PrintStream out)
Prints the stack trace of this exception to the specified print stream.

Parameters:
out - PrintStream to use for output

printStackTrace

public void printStackTrace(java.io.PrintWriter out)
Prints the stack trace of this exception to the specified print writer.

Parameters:
out - PrintWriter to use for output.

printStackTrace

public void printStackTrace(java.io.PrintWriter out,
                            int skip)
Prints the stack trace of this exception skiping a specified number of stack frames.

Parameters:
out - PrintWriter to use for output.
skip - the numbere of stack frames to skip.

captureStackTrace

private java.lang.String[] captureStackTrace()
Captures the stack trace associated with this exception.

Returns:
an array of Strings describing stack frames.

captureStackTrace

private java.lang.String[] captureStackTrace(java.lang.Throwable t)
Captures the stack trace associated with a Throwable object.

Parameters:
t - the Throwable.
Returns:
an array of Strings describing stack frames.

splitStackTrace

private java.lang.String[] splitStackTrace(java.lang.String stackTrace)
Splits the stack trace given as a newline separated string into an array of stack frames.

Parameters:
stackTrace - the stack trace.
Returns:
an array of Strings describing stack frames.


Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.