public class ApplicationException extends RuntimeException implements TopLevelException
Modifier and Type | Class and Description |
---|---|
static class |
ApplicationException.Level
Level for logging the exception.
|
Modifier and Type | Field and Description |
---|---|
protected String |
addText |
protected boolean |
allowHTMLMessage |
protected Object[] |
arguments |
protected ErrorFormatter |
ef |
static String |
EXCEPTION_MARKER |
protected int |
exceptionNumber |
protected boolean |
isWarning |
protected String |
title |
static String |
WRAPPER_MARKER |
Constructor and Description |
---|
ApplicationException(int errnum)
Construct an ApplicationException with an exception number.
|
ApplicationException(int errnum,
ApplicationException.Level level)
Construct an ApplicationException with an exception number.
|
ApplicationException(int errnum,
Object[] args)
Construct an ApplicationException with an exception number and args
|
ApplicationException(int errnum,
Object[] args,
Throwable cause)
Construct an ApplicationException with an exception number, args and the cause exception.
|
ApplicationException(int errnum,
Object[] args,
Throwable cause,
ApplicationException.Level level)
Construct an ApplicationException with an exception number, args and the cause exception.
|
ApplicationException(int errnum,
String msg,
Throwable cause)
Deprecated.
Don't use this signature, use placeholders and an argument array.
|
ApplicationException(int errnum,
Throwable cause)
Construct an ApplicationException with an exception number and the cause exception.
|
ApplicationException(Resource resource,
int errnum)
Construct an ApplicationException with an exception number and a resource.
|
ApplicationException(Resource resource,
int errnum,
Object[] args)
Construct an ApplicationException with a resource, exception number and args.
|
ApplicationException(Resource resource,
int errnum,
Object[] args,
Throwable cause)
Construct an ApplicationException with a resource, exception number, args and the cause exception.
|
ApplicationException(Resource resource,
int errnum,
String msg,
Throwable cause)
Deprecated.
Don't use this signature, use placeholders and an argument array.
|
ApplicationException(Resource resource,
int errnum,
Throwable cause)
Construct an ApplicationException with a resource, exception number, and the cause exception.
|
ApplicationException(String message)
Construct an ApplicationException with a message.
|
ApplicationException(String message,
Throwable cause)
Construct an ApplicationException with a message and the cause exception.
|
ApplicationException(String message,
Throwable cause,
ApplicationException.Level level)
Construct an ApplicationException with a message and the cause exception.
|
ApplicationException(Throwable cause)
Construct an ApplicationException with a cause exception.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowHTMLMessage() |
Object[] |
getArgs() |
static Class<?> |
getCallingClass()
Returns the name of the class which called the invoking method.
|
int |
getErrnum() |
ErrorFormatter |
getErrorFormatter()
Returns the error formatter for this exception.
|
Throwable |
getException()
Returns an inner exception, null if there is none.
|
String |
getMessage() |
String |
getMessageText()
return the plain message text without "Error" prefix and number
|
String |
getTitle()
get the title used for the error-popup on clientside
|
boolean |
isWarning() |
protected void |
log(String marker,
ApplicationException.Level level,
org.slf4j.Logger logger)
The cause is logged.
|
void |
setAllowHTMLMessage(boolean allowHTMLMessage)
set to
true to allow html-formatted error-messages, false by default |
void |
setErrorFormatter(ErrorFormatter ef)
Set the formatter for formatting the error page.
|
ApplicationException |
setTitle(String title)
set title of error-popup on clientside
|
void |
setWarning(boolean warning)
Set the exception type to warning.
|
static ApplicationException |
wrap(Throwable cause)
Conditionally wrap an exception.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final String EXCEPTION_MARKER
public static final String WRAPPER_MARKER
protected transient ErrorFormatter ef
protected int exceptionNumber
protected transient Object[] arguments
protected boolean isWarning
protected boolean allowHTMLMessage
protected String addText
protected String title
public ApplicationException(int errnum)
errnum
- the key in the enterprise errors resourcepublic ApplicationException(int errnum, ApplicationException.Level level)
errnum
- the key in the enterprise errors resourcelevel
- level for logging the exception, default is ERRORpublic ApplicationException(int errnum, Object[] args)
errnum
- the key in the given resourceargs
- message-format argumentspublic ApplicationException(int errnum, Object[] args, Throwable cause)
errnum
- the key in the given resourceargs
- message-format argumentscause
- the causing exceptionpublic ApplicationException(int errnum, Object[] args, Throwable cause, ApplicationException.Level level)
errnum
- the key in the given resourceargs
- message-format argumentscause
- the causing exceptionlevel
- level for logging the exception, default is ERRORpublic ApplicationException(int errnum, Throwable cause)
errnum
- the key in the given resourcecause
- the causing exceptionpublic ApplicationException(String message)
message
- the error messagepublic ApplicationException(String message, Throwable cause)
message
- the error messagecause
- the causing exceptionpublic ApplicationException(String message, Throwable cause, ApplicationException.Level level)
message
- the error messagecause
- the causing exceptionlevel
- level for logging the exception, default is ERRORpublic ApplicationException(Throwable cause)
cause
- the causing exceptionpublic ApplicationException(Resource resource, int errnum)
resource
- a resource containing the error messages.errnum
- the key in the given resourcepublic ApplicationException(Resource resource, int errnum, Object[] args)
resource
- a resource containing the error messageserrnum
- the key in the given resourceargs
- message-format argumentspublic ApplicationException(Resource resource, int errnum, Object[] args, Throwable cause)
resource
- a resource containing the error messageserrnum
- the key in the given resourceargs
- message-format argumentscause
- the causing exceptionpublic ApplicationException(Resource resource, int errnum, Throwable cause)
resource
- a resource containing the error messageserrnum
- the key in the given resourcecause
- the causing exception@Deprecated public ApplicationException(int errnum, String msg, Throwable cause)
errnum
- the key in the given resourcemsg
- text that is added to the message from the error resource.cause
- the causing exception@Deprecated public ApplicationException(Resource resource, int errnum, String msg, Throwable cause)
resource
- a resource containing the error messageserrnum
- the key in the given resourcemsg
- text that is added to the message from the error resource.cause
- the causing exceptionpublic static ApplicationException wrap(Throwable cause)
cause
- the causing Exceptionpublic static Class<?> getCallingClass()
public Object[] getArgs()
public int getErrnum()
getErrnum
in interface TopLevelException
public ErrorFormatter getErrorFormatter()
public Throwable getException()
TopLevelException
getException
in interface TopLevelException
public String getMessage()
getMessage
in class Throwable
public String getMessageText()
protected void log(String marker, ApplicationException.Level level, org.slf4j.Logger logger)
public void setErrorFormatter(ErrorFormatter ef)
ef
- public boolean allowHTMLMessage()
public void setAllowHTMLMessage(boolean allowHTMLMessage)
true
to allow html-formatted error-messages, false
by defaultallowHTMLMessage
- public ApplicationException setTitle(String title)
title
- public String getTitle()
public void setWarning(boolean warning)
setWarning
in interface TopLevelException
public boolean isWarning()
isWarning
in interface TopLevelException
@enterprise 10.0.38934 Copyright © 2001-2024 Groiss Informatics GmbH. All Rights Reserved.