com.filenet.api.exception
Class ErrorStack

java.lang.Object
  extended by com.filenet.api.exception.ErrorStack
All Implemented Interfaces:
java.io.Serializable

public class ErrorStack
extends java.lang.Object
implements java.io.Serializable

Contains a collection of ErrorRecord instances returned by the server. Each instance in the collection corresponds to an exception that was chained and returned by the server. Chained exceptions are placed in an ErrorStack object and stored in an EngineRuntimeException object.

See Also:
EngineRuntimeException, ErrorRecord, Serialized Form

Constructor Summary
ErrorStack(EngineRuntimeException ere)
          Creates an ErrorStack instance from an EngineRuntimeException object.
ErrorStack(java.lang.String errorName, ErrorRecord[] recs)
          Creates the ErrorStack instance by explicitly specifying the ErrorRecord object that the error stack is to contain.
 
Method Summary
 ErrorRecord[] getErrorRecords()
          Returns all ErrorRecord instances stored in this error stack.
 ExceptionCode getExceptionCode()
          Gets the ExceptionCode object for the current exception.
 java.lang.String getMessage()
          Gets the localized error text of the first ErrorRecord object in this error stack.
 java.lang.String toString()
          Returns a String representation of all records in this error stack.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorStack

public ErrorStack(EngineRuntimeException ere)
Creates an ErrorStack instance from an EngineRuntimeException object. Each exception that is chained in the EngineRuntimeException object becomes an ErrorRecord object stored in the ErrorStack instance.

Parameters:
ere - An EngineRuntimeException object containing the exception or chain of exceptions to add to the stack.

ErrorStack

public ErrorStack(java.lang.String errorName,
                  ErrorRecord[] recs)
Creates the ErrorStack instance by explicitly specifying the ErrorRecord object that the error stack is to contain.

Parameters:
errorName - A String containing the name to assign to the error stack. If null, this defaults to ExceptionCode.E_SERVER_ERROR.
recs - An ErrorRecord array containing the exceptions.
Method Detail

getErrorRecords

public ErrorRecord[] getErrorRecords()
Returns all ErrorRecord instances stored in this error stack.

Returns:
An ErrorRecord array containing all exceptions on the stack.

getExceptionCode

public ExceptionCode getExceptionCode()
Gets the ExceptionCode object for the current exception.

Returns:
An ExceptionCode object for this exception.

getMessage

public java.lang.String getMessage()
Gets the localized error text of the first ErrorRecord object in this error stack.

Returns:
A String containing the exception description for this exception.

toString

public java.lang.String toString()
Returns a String representation of all records in this error stack.

Overrides:
toString in class java.lang.Object
Returns:
A String representing all of the records in this error stack.


© Copyright IBM Corporation 2006, 2008. All rights reserved.