com.ibm.commerce.exception

Class ExceptionHandler

  • java.lang.Object
    • com.ibm.commerce.exception.ExceptionHandler


  • public class ExceptionHandler
    extends java.lang.Object
    This class contains methods & helper methods for converting Exception objects to ECException objects and generating ECException objects. This class is for internal use only.
    • Constructor Summary

      Constructors 
      Constructor and Description
      ExceptionHandler()
      This is the default constructor for this class.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String convertStackTraceToString(java.lang.Throwable throwable)
      This method converts the stack trace of the Throwable object to a String for tracing purposes.
      static ECException convertToECException(java.lang.Throwable e)
      This method converts an Exception object to an ECException object.
      static void displayJspException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception e)
      This method forwards the exception to a GenericSystemError view task to display the associated generic system error JSP.
      static TypedProperty getExceptionProperties(java.lang.Exception e)
      This method gets exception properties.
      static TypedProperty getExceptionProperties(java.lang.Throwable e)
      This method gets the exception properties.
      static com.ibm.websphere.command.CommandException getRootCommandException(com.ibm.websphere.command.CommandException e)
      This method gets the root exception from the CommandException.
      static ErrorDataBean handleJspException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception e)
      This method handles the JSP exception and gets an error data bean.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExceptionHandler

        public ExceptionHandler()
        This is the default constructor for this class. It calls the constructor from the superclass.
    • Method Detail

      • convertToECException

        public static ECException convertToECException(java.lang.Throwable e)
        This method converts an Exception object to an ECException object.
        Parameters:
        e - An Exception object to be converted.
        Returns:
        An ECException object.
      • displayJspException

        public static void displayJspException(javax.servlet.http.HttpServletRequest request,
                                               javax.servlet.http.HttpServletResponse response,
                                               java.lang.Exception e)
                                        throws javax.servlet.ServletException
        This method forwards the exception to a GenericSystemError view task to display the associated generic system error JSP. It is called by a JSP when it detects an exception.
        Parameters:
        request - An HttpServletRequest object.
        response - An HttpServletResponse object.
        e - A java.lang.Exception object.
        Throws:
        javax.servlet.ServletException
      • getExceptionProperties

        public static TypedProperty getExceptionProperties(java.lang.Throwable e)
        This method gets the exception properties.
        Parameters:
        e - A Throwable object.
        Returns:
        The exception properties.
      • getExceptionProperties

        public static TypedProperty getExceptionProperties(java.lang.Exception e)
        This method gets exception properties.
        Parameters:
        e - An Exception object.
        Returns:
        The exception properties.
      • getRootCommandException

        public static com.ibm.websphere.command.CommandException getRootCommandException(com.ibm.websphere.command.CommandException e)
        This method gets the root exception from the CommandException. The root exception can be the CommandException itself or an ECException.
        Parameters:
        e - An exception to be analyzed.
      • handleJspException

        public static ErrorDataBean handleJspException(javax.servlet.http.HttpServletRequest request,
                                                       javax.servlet.http.HttpServletResponse response,
                                                       java.lang.Exception e)
        This method handles the JSP exception and gets an error data bean.
        Parameters:
        request - An HttpServletRequest object.
        response - An HttpServletResponse object.
        e - A java.lang.Exception object.
        error - A data bean.
      • convertStackTraceToString

        public static java.lang.String convertStackTraceToString(java.lang.Throwable throwable)
        This method converts the stack trace of the Throwable object to a String for tracing purposes.
        Parameters:
        throwable - The Throwable object.
        Returns:
        The String representation of the stack trace.