com.ibm.workflow.portlet.client
Class ClientException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.ibm.workflow.portlet.client.ClientException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
NoSessionException

public class ClientException
extends java.lang.Exception

This is the base class for all exceptions thrown within the Web Client framework. It contains the servlet request during which the error occured and also can hold the nested exception, if any.

See Also:
Serialized Form

Constructor Summary
ClientException(javax.servlet.http.HttpServletRequest request, java.lang.String message)
          Constructs an exception object.
ClientException(javax.servlet.http.HttpServletRequest request, java.lang.Throwable xcpt)
          Constructs an exception object.
ClientException(javax.servlet.http.HttpServletRequest request, java.lang.Throwable xcpt, java.lang.String message)
          Constructs an exception object.
ClientException(RequestContext context, java.lang.String message)
          Constructs an exception object.
ClientException(RequestContext context, java.lang.Throwable xcpt)
          Constructs an exception object.
ClientException(RequestContext context, java.lang.Throwable xcpt, java.lang.String message)
          Constructs an exception object.
 
Method Summary
 java.lang.String getMessage()
          Returns the error message string of this exception.
 java.lang.Throwable getNestedException()
          Returns the nested exception, if any.
 javax.servlet.http.HttpServletRequest getRequest()
          Returns the HTTP request that caused this exception.
static java.lang.String getStack(java.lang.Throwable xcpt)
          Returns the stack trace of an exception as string.
 java.lang.String getTitle()
          Returns the error title string of this exception.
 void printStackTrace(java.io.PrintStream s)
          Prints this exception to the specified print stream.
 void printStackTrace(java.io.PrintWriter s)
          Prints this exception to the specified print writer.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientException

public ClientException(javax.servlet.http.HttpServletRequest request,
                       java.lang.String message)
Constructs an exception object.
Parameters:
request - the HTTP request
message - the error message

ClientException

public ClientException(javax.servlet.http.HttpServletRequest request,
                       java.lang.Throwable xcpt)
Constructs an exception object.
Parameters:
request - the HTTP request
xcpt - the exception that was thrown

ClientException

public ClientException(javax.servlet.http.HttpServletRequest request,
                       java.lang.Throwable xcpt,
                       java.lang.String message)
Constructs an exception object.
Parameters:
request - the HTTP request
xcpt - the exception that was thrown
message - the error message

ClientException

public ClientException(RequestContext context,
                       java.lang.String message)
Constructs an exception object.
Parameters:
context - the request context
message - the error message

ClientException

public ClientException(RequestContext context,
                       java.lang.Throwable xcpt)
Constructs an exception object.
Parameters:
context - the request context
xcpt - the exception that was thrown

ClientException

public ClientException(RequestContext context,
                       java.lang.Throwable xcpt,
                       java.lang.String message)
Constructs an exception object.
Parameters:
context - the request context
xcpt - the exception that was thrown
message - the error message
Method Detail

getStack

public static java.lang.String getStack(java.lang.Throwable xcpt)
Returns the stack trace of an exception as string.
Parameters:
xcpt - the exception from which to extract the stack trace
Returns:
the exception's stack trace

getTitle

public java.lang.String getTitle()
Returns the error title string of this exception. The title is either 'API error' or 'Servlet error'.
Returns:
the message title

getMessage

public java.lang.String getMessage()
Returns the error message string of this exception.
Overrides:
getMessage in class java.lang.Throwable
Returns:
the message text

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Returns the HTTP request that caused this exception.
Returns:
the HttpServletRequest object associated with this exception.

getNestedException

public java.lang.Throwable getNestedException()
Returns the nested exception, if any.
Returns:
the nested exception (may be null)

printStackTrace

public void printStackTrace(java.io.PrintStream s)
Prints this exception to the specified print stream. This call will be forwarded to printStackTrace(PrintWriter).
Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - the print stream to write to

printStackTrace

public void printStackTrace(java.io.PrintWriter s)
Prints this exception to the specified print writer. If this exception has a nested exception, the nested exception's stack trace will be printed instead.
Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - the print writer to write to


© Copyright IBM Corporation 2002, 2007. All Rights Reserved.