org.jasig.portal
Class ExceptionHelper

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

public class ExceptionHelper
extends Object


Constructor Summary
ExceptionHelper()
           
 
Method Summary
static String errorInfo(ErrorID eid, String parm, Throwable ex)
          Generate error string for logging or /problems online display
static void generateErrorPage(HttpServletResponse resp, Exception e)
          Generate HTML page to send to end user after fatal error
static void genericHandler(ErrorID eid, String parm, Throwable ex)
          Generic Exception Handler called from catch clause
static void genericHandler(ErrorID eid, Throwable ex)
           
static void genericTopHandler(ErrorID eid, String parm, Throwable t)
          Generic Top-Level Exception Handler caled from catch clause (doesn't rethrow exception)
static void genericTopHandler(ErrorID eid, Throwable ex)
           
static String shortStackTrace(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, String parm)
          Create PortalException from Errorid, trace, and throw it.
static void signal(ErrorID eid, String parm, boolean tracenow)
          Create PortalException from ErrorID and throw it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHelper

public ExceptionHelper()
Method Detail

shortStackTrace

public static String shortStackTrace(Throwable ex)
Generate traceback only to the Servlet-container interface.

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

genericHandler

public static void genericHandler(ErrorID eid,
                                  String parm,
                                  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,
                                  Throwable ex)
                           throws PortalException
Throws:
PortalException

signal

public static void signal(ErrorID eid,
                          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,
                          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

public static void signal(ErrorID eid)
                   throws PortalException
Generate, trace, and throw Portal Exception given ErrorID.

Parameters:
eid - ErrorID
Throws:
PortalException

errorInfo

public static String errorInfo(ErrorID eid,
                               String parm,
                               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,
                                     String parm,
                                     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,
                                     Throwable ex)

generateErrorPage

public static void generateErrorPage(HttpServletResponse resp,
                                     Exception e)
Generate HTML page to send to end user after fatal error

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


Copyright © 2010 Jasig. All Rights Reserved.