Documentation Archive Developer
Search
PATH Documentation > WebObjects

Table of Contents

NSForwardException


Inherits from:
RuntimeException : Exception : Throwable : Object
Package:
com.webobjects.foundation


Class Description


NSForwardException objects (or forward exceptions) are wrappers for Throwable objects that are not RuntimeExceptions. Since NSForwardException is a subclass of RuntimeException, forward exceptions can be omitted from the throws clause of a method even if the original exception had to be declared.

NSForwardException is used internally within WebObjects to keep the API congruent with the WebObjects 4.5 API (which uses the Java Bridge). Apple doesn't anticipate the need for you to create NSForwardException objects. You may need to catch them, however. To access the original exception, use the originalException method.




Method Types


Constructors
NSForwardException
Accessing the wrapped exception
originalException
Methods inherited from Throwable
printStackTrace
stackTrace
toString


Constructors



NSForwardException

public NSForwardException(Throwable exception)

public NSForwardException( Throwable exception, String extraMessage)

Creates an NSForwardException from exception. If exception is already an NSForwardException, the constructor wraps the exception's originalException.

The two-argument constructor allows you to specify an extra message; in this case, the new NSForwardException's message is exception's message with extraMessage appended. See the Throwable class specification in Sun's documentation for more information about an exception's messages.




Instance Methods



originalException

public Throwable originalException()

Returns the exception wrapped by the receiver.

printStackTrace

public void printStackTrace()

Prints the wrapped exception and its stack trace to the standard error stream. See the class specification for java.lang.Throwable in Sun's Java documentation for more information about the stack trace format.

public void printStackTrace(java.io.PrintStream printStream)

Prints the wrapped exception and its stack trace to the specified print stream.

public void printStackTrace(java.io.PrintWriter printWriter)

Prints the wrapped exception and its stack trace to the specified print writer.

stackTrace

public String stackTrace()

Returns a string containing the wrapped exception and its stack trace.

toString

public String toString()

Returns a string representation of the receiver indicating the receiver's class, its wrapped exception's class, and the wrapped exception's error message string.

© 2001 Apple Computer, Inc. (Last Published April 17, 2001)


Table of Contents