Class NavExceptionHelper

java.lang.Object
edu.internet2.middleware.grouper.ui.util.NavExceptionHelper
All Implemented Interfaces:
Serializable

public class NavExceptionHelper extends Object implements Serializable
Helper class centralise some Exception handling

Version:
$Id: NavExceptionHelper.java,v 1.3 2009-08-12 04:52:14 mchyzer Exp $
See Also:
  • Field Details

    • LOG

      protected static final org.apache.commons.logging.Log LOG
  • Constructor Details

    • NavExceptionHelper

      public NavExceptionHelper()
  • Method Details

    • key

      public String key(Throwable t)
      Takes class short name for Throwable and builds a key based on that. If the key is not present a default catch all is used.
      Parameters:
      t -
      Returns:
      key
    • getMessage

      public String getMessage(UnrecoverableErrorException cause)
      UnrecoverableErrorException can have its own message key and one associated with any 'cause'. This method takes care of building a message based on the available keys.
      Parameters:
      cause -
      Returns:
      message
    • missingParameters

      public String missingParameters(String... params)
      Helper method takes alternate parameter / parameter name pairs and constructs a message, if any are empty, indicating what is missing
      Parameters:
      params -
      Returns:
      missing parameters
    • missingAlternativeParameters

      public String missingAlternativeParameters(String... params)
      Helper method takes alternate parameter / parameter name pairs and constructs a message, if any are empty, indicating what is missing
      Parameters:
      params -
      Returns:
      missing parameters
    • fillInStacktrace

      public static Exception fillInStacktrace(Exception e)
      Allows code which constructs an Exception to add a stack trace
      Parameters:
      e -
      Returns:
      the input Exception
    • toLog

      public static String toLog(Throwable t)
      Captures the stack trace for an Exception so it can be logged
      Parameters:
      t -
      Returns:
      the stack trace as a String