Class ApplicationError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- de.uni_trier.wi2.procake.utils.exception.ApplicationError
-
- All Implemented Interfaces:
Serializable
public class ApplicationError extends Error
An ApplicationError should be thrown for fatal application errors, e.g.,OutOfMemoryError. Such errors are not necessary to specify in the "throws" part of a message declaration. For example, errors in constructors must be thrown as an error.An ApplicationError extends
Errorwith additional information. This information include the component, the key, the caller, and additional parameters. They can be used by theLoggerin respect by theMessageFormatter. Especially the logger provides special methods to log an exception, seeLogger.log(Level, CakeException).The component and the key should be defined with the same concept as for the
Logger. But the exceptions are not logged automatically. To log an CakeException the exception has to be catched and logged manually:try { // some code that throws an CakeException } catch (CakeException ex) { cake.logger.LoggerFactory.getLogger(ex.getComponent()).log(Level.INFO, ex); }- Author:
- Rainer Maximini
- See Also:
Logger,MessageFormatter, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApplicationError(String description)Only for backward compatibility, will be removed in one of the next versions.ApplicationError(String component, String key, Object caller)ApplicationError(String component, String key, Object caller, Object parameter2)ApplicationError(String component, String key, Object caller, Object[] parameters)ApplicationError(String component, String key, Object caller, Object parameter1, Object parameter2)ApplicationError(String component, String key, Object caller, Object parameter1, Object parameter2, Object parameter3)ApplicationError(String component, String key, Object caller, Object parameter1, Object parameter2, Object parameter3, Object parameter4)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetCaller()StringgetComponent()StringgetKey()Object[]getParameters()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ApplicationError
public ApplicationError(String description)
Only for backward compatibility, will be removed in one of the next versions.- Parameters:
description- An exception description.
-
ApplicationError
public ApplicationError(String component, String key, Object caller)
- Parameters:
component- the log compomentkey- the log keycaller- the caller of the exception- See Also:
Logger
-
ApplicationError
public ApplicationError(String component, String key, Object caller, Object parameter2)
- Parameters:
component- the log compomentkey- the log keycaller- the caller of the exception- See Also:
Logger
-
ApplicationError
public ApplicationError(String component, String key, Object caller, Object[] parameters)
- Parameters:
component- the log compomentkey- the log keycaller- the caller of the exceptionparameters- an array of parameters- See Also:
Logger
-
ApplicationError
public ApplicationError(String component, String key, Object caller, Object parameter1, Object parameter2)
- Parameters:
component- the log compomentkey- the log keycaller- the caller of the exceptionparameter1- the first parameterparameter2- the first parameter- See Also:
Logger
-
ApplicationError
public ApplicationError(String component, String key, Object caller, Object parameter1, Object parameter2, Object parameter3)
- Parameters:
component- the log compomentkey- the log keycaller- the caller of the exceptionparameter1- the first parameterparameter2- the first parameterparameter3- the first parameter- See Also:
Logger
-
ApplicationError
public ApplicationError(String component, String key, Object caller, Object parameter1, Object parameter2, Object parameter3, Object parameter4)
- Parameters:
component- the log compomentkey- the log keycaller- the caller of the exceptionparameter1- the first parameterparameter2- the first parameterparameter3- the first parameterparameter4- the first parameter- See Also:
Logger
-
-