Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal
Class ExceptionHelper

    java.lang.Object
      org.jasig.portal.ExceptionHelper

    public class ExceptionHelper

extends java.lang.Object

Field Summary
`private static java.lang.String[]` | `boundaries`
`private static org.apache.commons.logging.Log` | `log`

Constructor Summary
`ExceptionHelper()`

Method Summary
`static java.lang.String` | `errorInfo(ErrorID eid, java.lang.String parm, java.lang.Throwable ex)` Generate error string for logging or /problems online display
`static void` | `generateErrorPage(javax.servlet.http.HttpServletResponse resp, java.lang.Exception e)` Generate HTML page to send to end user after fatal error
`static void` | `genericHandler(ErrorID eid, java.lang.String parm, java.lang.Throwable ex)` Generic Exception Handler called from catch clause
`static void` | `genericHandler(ErrorID eid, java.lang.Throwable ex)`
`static void` | `genericTopHandler(ErrorID eid, java.lang.String parm, java.lang.Throwable t)` Generic Top-Level Exception Handler caled from catch clause (doesn't rethrow exception)
`static void` | `genericTopHandler(ErrorID eid, java.lang.Throwable ex)`
`static java.lang.String` | `shortStackTrace(java.lang.Throwable ex)` Generate traceback only to the Servlet-container interface.
`static void` | `signal(ErrorID eid)` Generate, trace, and throw Portal Exception given ErrorID.
`static void` | `signal(ErrorID eid, java.lang.String parm)` Create PortalException from Errorid, trace, and throw it.
`static void` | `signal(ErrorID eid, java.lang.String parm, boolean tracenow)` Create PortalException from ErrorID and throw it.
`private static void` | `signal(PortalException nex, boolean tracenow)` Throw PortalException provided by caller, maybe trace it.
`private static void` | `traceToLog(ErrorID eid, java.lang.String parm, java.lang.Throwable ex)` Common logic for generating log entry of errors
`(package private) static java.lang.String` | `trimStackTrace(java.lang.String stackTrace)` Trims a String representation of a Stack Trace to remove the portion of the trace that is in the servlet container layer.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    private static final org.apache.commons.logging.Log log

### boundaries

    private static final java.lang.String[] boundaries

Constructor Detail

### ExceptionHelper

    public ExceptionHelper()

Method Detail

### shortStackTrace

    public static java.lang.String shortStackTrace(java.lang.Throwable ex)

  Generate traceback only to the Servlet-container interface.

  Parameters:
    `ex` - any throwable exception
  Returns:
    stack trace string without container layers

### trimStackTrace

    static java.lang.String trimStackTrace(java.lang.String stackTrace)

  Trims a String representation of a Stack Trace to remove the portion of the trace that is in the servlet container layer.

  Parameters:
    `stackTrace` - - String result of printStackTrace
  Returns:
    the stack trace with portions of the trace that dive into the container layer removed.

### genericHandler

    public static void genericHandler(ErrorID eid,
                                      java.lang.String parm,
                                      java.lang.Throwable ex)
                               throws PortalException

  Generic Exception Handler called from catch clause

  Parameters:
    `eid` - the ErrorID (as seen from catch)
    `parm` -
    `ex` - the Exception caught
  Throws:
    `PortalException`

### genericHandler

    public static void genericHandler(ErrorID eid,
                                      java.lang.Throwable ex)
                               throws PortalException

  Throws:
    `PortalException`

### signal

    public static void signal(ErrorID eid,
                              java.lang.String parm,
                              boolean tracenow)
                       throws PortalException

  Create PortalException from ErrorID and throw it. Maybe trace it.

  Parameters:
    `eid` - ErrorId
    `parm` - Additional error information
    `tracenow` - Trace now or defer till first catch.
  Throws:
    `PortalException`

### signal

    public static void signal(ErrorID eid,
                              java.lang.String parm)
                       throws PortalException

  Create PortalException from Errorid, trace, and throw it.

  Parameters:
    `eid` - ErrorID to use to generate PortalException
    `parm` - Additional error information
  Throws:
    `PortalException`

### signal

    private static void signal(PortalException nex,
                               boolean tracenow)
                        throws PortalException

  Throw PortalException provided by caller, maybe trace it.

  Parameters:
    `nex` - Exception provided by caller
    `tracenow` - Trace now, or later after first catch.
  Throws:
    `PortalException`

### signal

    public static void signal(ErrorID eid)
                       throws PortalException

  Generate, trace, and throw Portal Exception given ErrorID.

  Parameters:
    `eid` - ErrorID
  Throws:
    `PortalException`

### traceToLog

    private static void traceToLog(ErrorID eid,
                                   java.lang.String parm,
                                   java.lang.Throwable ex)

  Common logic for generating log entry of errors

  Parameters:
    `eid` - ErrorID with initial message
    `parm` - Parameter string to append to eid msg
    `ex` - Old exception

### errorInfo

    public static java.lang.String errorInfo(ErrorID eid,
                                             java.lang.String parm,
                                             java.lang.Throwable ex)

  Generate error string for logging or /problems online display

  Parameters:
    `eid` - Error ID
    `parm` - Parameter string
    `ex` - Exception
  Returns:
    Multiline text with message and traceback

### genericTopHandler

    public static void genericTopHandler(ErrorID eid,
                                         java.lang.String parm,
                                         java.lang.Throwable t)

  Generic Top-Level Exception Handler caled from catch clause (doesn't rethrow exception)

  Parameters:
    `eid` - Error ID
    `parm` - Parameter string
    `t` - Exception caught

### genericTopHandler

    public static void genericTopHandler(ErrorID eid,
                                         java.lang.Throwable ex)

### generateErrorPage

    public static void generateErrorPage(javax.servlet.http.HttpServletResponse resp,
                                         java.lang.Exception e)

  Generate HTML page to send to end user after fatal error

  Parameters:
    `resp` - Servlet response object
    `e` - PortalException received at Servlet code.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD