Package org.eclipse.birt.core.exception
Class BirtException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.eclipse.birt.core.exception.BirtException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CoreException
,FrameworkException
Define BIRT's Exception framework. Every BIRT exception has to include an
error code, which is a string. Different BIRT modules use different prefix
for error codes. For example,
DE uses DESIGN_EXCEPTION_
DtE uses DATA_EXCEPTION_
FPE uses GENERATION_EXCEPTION_ and VIEW_EXCEPTION_
UI uses UI_EXCEPTION_
Chart used CHART_EXCEPTION_
viewer uses VIERER_EXCEPTION_
as prefix. An error code is used for retrieving error message, which is
externalizable, and can be seen by end users. The error code itself allows
the identification of the subcomponent that generates the exception, avoiding
the need to create exceltion subclasses such as BirtEngineException,
BirtDtEException, etc.
Note that the resource key (or error code), message arguments and resource
bundle are immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Status type severity (bit mask, value 8) indicating this exception represents a cancelationstatic final int
Status type severity (bit mask, value 4) indicating this exception represents an error.static final int
Status type severity (bit mask, value 1) indicating this exception is informational only.protected final Object[]
Optional arguments to be used with a resource key to build the error messagestatic final int
Status severity constant (value 0) indicating this exception represents the nominal case.protected String
The unique identifier of the plug-in associated with this exceptionprotected final ResourceBundle
The resource bundle that holds a collection of messages for a specific localeprotected int
The severity of this exception.protected final String
The resource key that represents the internal error code used in fetching an externalized messagestatic final int
Status type severity (bit mask, value 2) indicating this exception represents a warning. -
Constructor Summary
ConstructorsConstructorDescriptionBirtException
(String message) BirtException
(String errorCode, Object arg0) Deprecated.BirtException
(String errorCode, Object[] args, Throwable cause) Deprecated.BirtException
(String errorCode, Object[] args, ResourceBundle bundle) Deprecated.BirtException
(String errorCode, Object[] args, ResourceBundle bundle, Throwable cause) Deprecated.BirtException
(String errorCode, Object arg0, ResourceBundle bundle) Deprecated.BirtException
(String errorCode, Object arg0, ResourceBundle bundle, Throwable cause) Deprecated.BirtException
(String pluginId, String errorCode, Object arg0) BirtException
(String pluginId, String errorCode, Object[] args, Throwable cause) BirtException
(String pluginId, String errorCode, Object[] args, ResourceBundle bundle) BirtException
(String pluginId, String errorCode, Object[] args, ResourceBundle bundle, Throwable cause) BirtException
(String pluginId, String errorCode, Object arg0, ResourceBundle bundle) BirtException
(String pluginId, String errorCode, Object arg0, ResourceBundle bundle, Throwable cause) BirtException
(String pluginId, String errorCode, ResourceBundle bundle) Constructs a new Birt exception with no cause object.BirtException
(String pluginId, String errorCode, ResourceBundle bundle, Throwable cause) BirtException
(String errorCode, ResourceBundle bundle) Deprecated.Constructs a new Birt exception with no cause object.BirtException
(String errorCode, ResourceBundle bundle, Throwable cause) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getLocalizedMessage
(String errorCode) Returns a localized message based on an error code.Returns the unique identifier of the plug-in associated with this exception (this is the plug-in that defines the meaning of the error code).int
Returns the severity.void
setSeverity
(int severity) Sets the severity of the exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
sResourceKey
The resource key that represents the internal error code used in fetching an externalized message -
oaMessageArguments
Optional arguments to be used with a resource key to build the error message -
rb
The resource bundle that holds a collection of messages for a specific locale -
pluginId
The unique identifier of the plug-in associated with this exception -
severity
protected int severityThe severity of this exception. One ofCANCEL
ERROR
(default value)WARNING
INFO
- or
OK
(0)
-
OK
public static final int OKStatus severity constant (value 0) indicating this exception represents the nominal case. This constant is also used as the status code representing the nominal case.- See Also:
-
INFO
public static final int INFOStatus type severity (bit mask, value 1) indicating this exception is informational only.- See Also:
-
WARNING
public static final int WARNINGStatus type severity (bit mask, value 2) indicating this exception represents a warning.- See Also:
-
ERROR
public static final int ERRORStatus type severity (bit mask, value 4) indicating this exception represents an error.- See Also:
-
CANCEL
public static final int CANCELStatus type severity (bit mask, value 8) indicating this exception represents a cancelation- See Also:
-
-
Constructor Details
-
BirtException
- Parameters:
mesage
- error message
-
BirtException
Deprecated.Constructs a new Birt exception with no cause object.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.
-
BirtException
Deprecated.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.cause
- the nested exception
-
BirtException
@Deprecated public BirtException(String errorCode, Object[] args, ResourceBundle bundle, Throwable cause) Deprecated.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.args
- string arguments used to format error messages
-
BirtException
@Deprecated public BirtException(String errorCode, Object arg0, ResourceBundle bundle, Throwable cause) Deprecated.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.cause
- the nested exceptionarg0
- first argument used to format error messages
-
BirtException
Deprecated.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.args
- string arguments used to format error messages
-
BirtException
Deprecated.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.cause
- the nested exceptionarg0
- first argument used to format error messages
-
BirtException
Deprecated.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.arg0
- first argument used to format error messages
-
BirtException
Deprecated.- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.cause
- the nested exceptionargs
- string arguments used to format error messages
-
BirtException
Constructs a new Birt exception with no cause object.- Parameters:
pluginId
- Returns the unique identifier of the plug-in associated with this exception *errorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.
-
BirtException
public BirtException() -
BirtException
- Parameters:
pluginId
- Returns the unique identifier of the plug-in associated with this exceptionerrorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.cause
- the nested exception
-
BirtException
public BirtException(String pluginId, String errorCode, Object[] args, ResourceBundle bundle, Throwable cause) - Parameters:
pluginId
- Returns the unique identifier of the plug-in associated with this exceptionerrorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.args
- string arguments used to format error messages
-
BirtException
public BirtException(String pluginId, String errorCode, Object arg0, ResourceBundle bundle, Throwable cause) - Parameters:
pluginId
- Returns the unique identifier of the plug-in associated with this exceptionerrorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.cause
- the nested exceptionarg0
- first argument used to format error messages
-
BirtException
- Parameters:
pluginId
- Returns the unique identifier of the plug-in associated with this exceptionerrorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.args
- string arguments used to format error messages
-
BirtException
- Parameters:
pluginId
- Returns the unique identifier of the plug-in associated with this exceptionerrorCode
- used to retrieve a piece of externalized message displayed to end user.resourceBundle
- the resourceBundle used to translate the message.cause
- the nested exceptionarg0
- first argument used to format error messages
-
BirtException
- Parameters:
pluginId
- Returns the unique identifier of the plug-in associated with this exceptionseverity
-errorCode
- used to retrieve a piece of externalized message displayed to end user.arg0
- first argument used to format error messages
-
BirtException
- Parameters:
errorCode
- used to retrieve a piece of externalized message displayed to end user.cause
- the nested exceptionargs
- string arguments used to format error messages
-
-
Method Details
-
getErrorCode
- Returns:
- Returns the errorCode.
-
getLocalizedMessage
- Overrides:
getLocalizedMessage
in classThrowable
-
getMessage
- Overrides:
getMessage
in classThrowable
-
getLocalizedMessage
Returns a localized message based on an error code. Overwrite this method if you do not want to pass in the resource bundle- Parameters:
errorCode
- the error code- Returns:
- Localized display message.
-
getPluginId
Returns the unique identifier of the plug-in associated with this exception (this is the plug-in that defines the meaning of the error code).- Returns:
- the unique identifier of the relevant plug-in
-
getSeverity
public int getSeverity()Returns the severity. The severities are as follows (in descending order):CANCEL
- cancelation occurredERROR
- a serious error (most severe)WARNING
- a warning (less severe)INFO
- an informational ("fyi") message (least severe)OK
- everything is just fine
- Returns:
- the severity: one of
OK
,ERROR
,INFO
,WARNING
, orCANCEL
-
setSeverity
public void setSeverity(int severity) Sets the severity of the exception.- Parameters:
severity
- the severity; one ofOK
,ERROR
,INFO
,WARNING
, orCANCEL
-