Class ControllerException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.deltava.util.ControllerException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CommandException, DAOException, GenericServlet.ForbiddenException, GenericServlet.NotFoundException, ServiceException

public abstract class ControllerException extends Exception
An exception class to define a common singure for exceptions handled by the Command Controller servlet.
Since:
1.0
Version:
11.2
Author:
Luke
See Also:
  • Constructor Details

    • ControllerException

      public ControllerException(Throwable t)
      Wraps a thrown exception. This assumes the stack trace of the original execption.
      Parameters:
      t - the thrown exception to wrap
      See Also:
    • ControllerException

      public ControllerException(String msg)
      Creates a new controller exception with a given message.
      Parameters:
      msg - the message for the exception
    • ControllerException

      public ControllerException(String msg, Throwable t)
      Create a new ControllerException with an error message and underlying cause.
      Parameters:
      msg - the error message
      t - the root cause Exception
  • Method Details

    • getLogStackDump

      public boolean getLogStackDump()
      Returns whether the handling class should log this Exception's stack trace.
      Returns:
      TRUE if the stack trace should be logged, otherwise FALSE
      See Also:
    • getForwardURL

      public String getForwardURL()
      Returns the URL that the Controller servlet should forward the request to.
      Returns:
      the URL to forward to, or null
      See Also:
    • isWarning

      public boolean isWarning()
      Returns whether this exception to be logged as a warning, not an error.
      Returns:
      TRUE if a warning, otherwise FALSE
      See Also:
    • isSuppressed

      public boolean isSuppressed()
      Returns whether this exception should not be logged.
      Returns:
      TRUE if not logged, otherwise FALSE
      See Also:
    • getStatusCode

      public int getStatusCode()
      Returns the HTTP status code to set on the error page.
      Returns:
      the HTTP status code
      See Also:
    • setLogStackDump

      public void setLogStackDump(boolean doLog)
      Updates whether the handling class should log this Exception's stack trace.
      Parameters:
      doLog - TRUE if the stack trace should be logged, otherwise FALSE
      See Also:
    • setForwardURL

      public void setForwardURL(String url)
      Updates the URL that the Controller servlet should forward the request to.
      Parameters:
      url - the URL to forward to
      See Also:
    • setWarning

      public void setWarning(boolean isWarn)
      Sets this exception to be logged as a warning, not an error.
      Parameters:
      isWarn - TRUE if a warning, otherwise FALSE
      See Also:
    • setSuppressed

      public void setSuppressed(boolean isSuppress)
      Sets this exception to not be logged.
      Parameters:
      isSuppress - TRUE if suppressed, otherwise FALSE
      See Also:
    • setStatusCode

      public void setStatusCode(int code)
      Sets the HTTP status code to set on the error page.
      Parameters:
      code - the HTTP status code
      See Also: