org.tentackle.util
Class ApplicationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.tentackle.util.ApplicationException
All Implemented Interfaces:
Serializable

public class ApplicationException
extends Exception

Application Exception.
Same as Exception but will be shown to the user in FormError and can be used as a tagged exception for all internal application errors.

Author:
harald
See Also:
Serialized Form

Field Summary
static int ERROR_DEFAULT
          the default error code
 
Constructor Summary
ApplicationException(String message)
          Creates an ApplicationException.
ApplicationException(String message, int errorCode)
          Creates an ApplicationException.
ApplicationException(String message, int errorCode, Throwable cause)
          Creates an ApplicationException.
ApplicationException(String message, Throwable cause)
          Creates an ApplicationException.
 
Method Summary
 String getAllMessages()
          Gets the chain of all messages (if exception is cascaded).
Any Exception other than ApplicationException will be stacktraced.
 int getErrorCode()
          Gets the errorcode.
 String getStackTraceAsString()
          Returns the stacktrace of this exception as a string.
static String getStackTraceAsString(Throwable cause)
          Returns the stacktrace of a given exception as a string.
 void setErrorCode(int errorCode)
          Sets the errorcode.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_DEFAULT

public static final int ERROR_DEFAULT
the default error code

See Also:
Constant Field Values
Constructor Detail

ApplicationException

public ApplicationException(String message,
                            int errorCode,
                            Throwable cause)
Creates an ApplicationException.

Parameters:
message - the message, null if none
errorCode - the errorcode
cause - the chained cause, null if none

ApplicationException

public ApplicationException(String message,
                            int errorCode)
Creates an ApplicationException.

Parameters:
message - the message, null if none
errorCode - the errorcode

ApplicationException

public ApplicationException(String message)
Creates an ApplicationException.

Parameters:
message - the message, null if none

ApplicationException

public ApplicationException(String message,
                            Throwable cause)
Creates an ApplicationException.

Parameters:
message - the message, null if none
cause - the chained cause, null if none
Method Detail

getStackTraceAsString

public static String getStackTraceAsString(Throwable cause)
Returns the stacktrace of a given exception as a string.

Parameters:
cause - the exception
Returns:
the printable stacktrace

getErrorCode

public int getErrorCode()
Gets the errorcode.

Returns:
the errorcode

setErrorCode

public void setErrorCode(int errorCode)
Sets the errorcode.

Parameters:
errorCode - the errorcode

getStackTraceAsString

public String getStackTraceAsString()
Returns the stacktrace of this exception as a string.

Returns:
the printable stacktrace

getAllMessages

public String getAllMessages()
Gets the chain of all messages (if exception is cascaded).
Any Exception other than ApplicationException will be stacktraced.

Returns:
the message string


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de