Package org.opencms.main
Class CmsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.opencms.main.CmsException
- All Implemented Interfaces:
Serializable,I_CmsThrowable
- Direct Known Subclasses:
CmsConfigurationException,CmsDataAccessException,CmsFlexCacheException,CmsImportExportException,CmsIndexException,CmsInvalidActionException,CmsLoaderException,CmsLockException,CmsMessageException,CmsMultiException,CmsNewParentNotInWorkflowException,CmsPasswordEncryptionException,CmsPublishException,CmsResourceInitException,CmsRfsException,CmsSchedulerException,CmsSearchException,CmsSecurityException,CmsStaticExportException,CmsSynchronizeException,CmsWidgetException,CmsWorkplaceException,CmsXmlException
Master exception type for all exceptions caused in OpenCms.
- Since:
- 6.0.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CmsMessageContainerThe container for the localized message. -
Constructor Summary
ConstructorsConstructorDescriptionCmsException(CmsMessageContainer message) Creates a new localized Exception.CmsException(CmsMessageContainer message, Throwable cause) Creates a new localized Exception that also containers a root cause. -
Method Summary
Modifier and TypeMethodDescriptioncreateException(CmsMessageContainer container, Throwable cause) Creates a copied instance of this localized exception.static StringReturns the HTML formatted error stack of a Throwable.Returns a localized exception message based on the OpenCms default locale.getLocalizedMessage(Locale locale) Returns a localized exception message based on the given Locale.Returns a localized exception message based on the OpenCms default locale.Returns the localized message container used to build this localized exception.static StringReturns the stack trace (including the message) of an exception as a String.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
m_message
The container for the localized message.
-
-
Constructor Details
-
CmsException
Creates a new localized Exception.- Parameters:
message- the localized message container to use
-
CmsException
Creates a new localized Exception that also containers a root cause.- Parameters:
message- the localized message container to usecause- the Exception root cause
-
-
Method Details
-
getFormattedErrorstack
Returns the HTML formatted error stack of a Throwable.The error stack is used by the common error screen that is displayed if an error occurs.
- Parameters:
t- the throwable to get the errorstack from- Returns:
- the formatted value of the errorstack parameter
-
getStackTraceAsString
Returns the stack trace (including the message) of an exception as a String.If the exception is a CmsException, also writes the root cause to the String.
- Parameters:
e- the exception to get the stack trace from- Returns:
- the stack trace of an exception as a String
-
createException
Creates a copied instance of this localized exception.- Parameters:
container- the message containercause- the root cause- Returns:
- a copied instance of this localized exception
-
getLocalizedMessage
Description copied from interface:I_CmsThrowableReturns a localized exception message based on the OpenCms default locale.- Specified by:
getLocalizedMessagein interfaceI_CmsThrowable- Overrides:
getLocalizedMessagein classThrowable- Returns:
- a localized exception message based on the OpenCms default locale
- See Also:
-
getLocalizedMessage
Description copied from interface:I_CmsThrowableReturns a localized exception message based on the given Locale.- Specified by:
getLocalizedMessagein interfaceI_CmsThrowable- Parameters:
locale- the Locale to get the message for- Returns:
- a localized exception message based on the given Locale
- See Also:
-
getMessage
Description copied from interface:I_CmsThrowableReturns a localized exception message based on the OpenCms default locale.- Specified by:
getMessagein interfaceI_CmsThrowable- Overrides:
getMessagein classThrowable- Returns:
- a localized exception message based on the OpenCms default locale
- See Also:
-
getMessageContainer
Description copied from interface:I_CmsThrowableReturns the localized message container used to build this localized exception.- Specified by:
getMessageContainerin interfaceI_CmsThrowable- Returns:
- the localized message container used to build this localized exception
- See Also:
-