Package com.microstrategy.utils
Class MSTRCheckedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.microstrategy.utils.MSTRCheckedException
-
- All Implemented Interfaces:
LocalizableException
,java.io.Serializable
- Direct Known Subclasses:
ArgumentUnresolvedException
,CacheException
,ComparisonUnresolvedException
,ConfigException
,EmptyListException
,KerberosConfigurationException
,LayoutParsingException
,LicensingException
,MalformedMethodException
,MobileConfigurationException
,MonitorManipulationException
,MSTRAccessDeniedException
,MSTRSecurityException
,MSTRWebAPIException
,PreferencesException
,ServerConfigException
,TransformCreationException
,TransformDoesNotExistException
,TypeUnsupportedException
,UpgradeException
,WebBeanException
,WebElementSearchFilterBuilder.ParserException
,WebException
,WebFailedServerException
,WebObjectsAdminException
,WebObjectsException
,WebUtilsException
,XMLSupportException
public class MSTRCheckedException extends java.lang.Exception implements LocalizableException
- Since:
- MicroStrategy Web 7.3.1 or earlier
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MSTRCheckedException.ExceptionXMLHandler
This handler is used to parse XML error messages, and provides a means to extract a more meaningful message out of it.
-
Constructor Summary
Constructors Constructor Description MSTRCheckedException()
Constructor.MSTRCheckedException(int errorCode)
Deprecated.use other constructor insteadMSTRCheckedException(int code, java.lang.Object[] params, java.lang.Throwable e, java.util.Locale locale)
Deprecated.use other constructor insteadMSTRCheckedException(int code, java.lang.Object[] params, java.util.Locale locale)
Deprecated.use other constructor insteadMSTRCheckedException(LocalizableMessage errorMsg)
Constructor.MSTRCheckedException(LocalizableMessage errorMsg, java.lang.Throwable e)
Constructor.MSTRCheckedException(java.lang.String errorMsg)
Constructor.MSTRCheckedException(java.lang.String errorMsg, int errorCode)
Constructor.MSTRCheckedException(java.lang.String errorMsg, int errorCode, java.lang.Throwable e)
Constructor.MSTRCheckedException(java.lang.Throwable e)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
getCause()
Retrieves the embedded throwable (or null if none).java.util.Locale
getDefaultLocale()
Returns default locale of this exception.int
getErrorCode()
Returns the error code associated with the given error.LocalizableMessage
getLocalizableMessage()
ReturnsLocalizableMessage
object of this exception.java.lang.String
getMessage()
Returns the error message.java.lang.String
getMessage(boolean useXMLHandler)
In some special scenarios, the message returned by the Intelligence Server is in XML form.java.lang.String
getMessage(java.util.Locale locale)
Returns localized error message of this exception.java.lang.Throwable
getRootCause()
Follows thegetCause
chain to get the root cause.static java.lang.Throwable
getRootCause(java.lang.Throwable e)
void
setCause(java.lang.Throwable e)
Set the embedded errorvoid
setDefaultLocale(java.util.Locale locale)
Sets the default locale of this exception.void
setXMLHandler(MSTRCheckedException.ExceptionXMLHandler handler)
In some special scenarios, the message returned by the Intelligence Server is in XML form.
-
-
-
Constructor Detail
-
MSTRCheckedException
public MSTRCheckedException(LocalizableMessage errorMsg)
Constructor.- Parameters:
errorMsg
- The error message for this exception.- Since:
- MicroStrategy Web 8.0.0
-
MSTRCheckedException
public MSTRCheckedException(LocalizableMessage errorMsg, java.lang.Throwable e)
Constructor.- Parameters:
errorMsg
- The error message for this exception.e
- The embedded error object.- Since:
- MicroStrategy Web 8.0.0
-
MSTRCheckedException
public MSTRCheckedException(int code, java.lang.Object[] params, java.util.Locale locale)
Deprecated.use other constructor insteadConstructor.- Parameters:
code
- error code.locale
- The locale to localize this exception.params
- The parameters required to constructing the error message based on error code.- Since:
- MicroStrategy Web 8.0.0
-
MSTRCheckedException
public MSTRCheckedException(int code, java.lang.Object[] params, java.lang.Throwable e, java.util.Locale locale)
Deprecated.use other constructor insteadConstructor.- Parameters:
code
- error code.locale
- The locale to localize this exception.params
- The parameters required to constructing the error message based on error code.e
- The embedded error.- Since:
- MicroStrategy Web 8.0.0
-
MSTRCheckedException
public MSTRCheckedException()
Constructor.
-
MSTRCheckedException
public MSTRCheckedException(java.lang.String errorMsg)
Constructor.- Parameters:
errorMsg
- The error message for this exception.
-
MSTRCheckedException
public MSTRCheckedException(int errorCode)
Deprecated.use other constructor insteadConstructor.- Parameters:
errorCode
- The error code for this exception.
-
MSTRCheckedException
public MSTRCheckedException(java.lang.String errorMsg, int errorCode)
Constructor.- Parameters:
errorCode
- The error code for this exception.errorMsg
- The error message for this exception.
-
MSTRCheckedException
public MSTRCheckedException(java.lang.String errorMsg, int errorCode, java.lang.Throwable e)
Constructor.- Parameters:
errorCode
- The error code for this exception.errorMsg
- The error message for this exception.e
- The embedded error.
-
MSTRCheckedException
public MSTRCheckedException(java.lang.Throwable e)
Constructor.- Parameters:
e
- The embedded error.
-
-
Method Detail
-
getErrorCode
public int getErrorCode()
Returns the error code associated with the given error. If this is 0 (i.e. the error had no code associated with it), and the message is also null, it will first examine if there is an embedded exceptiongetCause()
, if so and it is either a MSTRCheckedException or MSTRUncheckedException, it will attempt to return their error code instead (recursively searching). If the error code is non-zero or the message is not null, the error code of this exception is returned.- Specified by:
getErrorCode
in interfaceLocalizableException
- Returns:
- The error code for the given error.
-
getMessage
public java.lang.String getMessage()
Returns the error message. If this is null and the error code is 0, it will first examine if there is an embedded exceptiongetCause()
, if so and it is either a MSTRCheckedException or MSTRUncheckedException, it will attempt to return their error message instead (recursively searching). If the message is not null or the error code is non-zero, the message of this exception is returned.- Specified by:
getMessage
in interfaceLocalizableException
- Overrides:
getMessage
in classjava.lang.Throwable
- Returns:
- The error message.
-
getMessage
public java.lang.String getMessage(java.util.Locale locale)
Returns localized error message of this exception.- Specified by:
getMessage
in interfaceLocalizableException
- Parameters:
locale
- locale- Returns:
- Localized error message.
- Since:
- MicroStrategy Web 8.0.0
-
getCause
public java.lang.Throwable getCause()
Retrieves the embedded throwable (or null if none).- Overrides:
getCause
in classjava.lang.Throwable
- Returns:
- The embedded throwable.
-
getRootCause
public java.lang.Throwable getRootCause()
Follows thegetCause
chain to get the root cause.
-
getRootCause
public static java.lang.Throwable getRootCause(java.lang.Throwable e)
-
setCause
public void setCause(java.lang.Throwable e)
Set the embedded error- Parameters:
e
- The embedded error
-
getLocalizableMessage
public LocalizableMessage getLocalizableMessage()
ReturnsLocalizableMessage
object of this exception. If this exception does not have a message but the embedded error has one, the one from embedded will return.- Specified by:
getLocalizableMessage
in interfaceLocalizableException
- Returns:
LocalizableMessage
object of this exception.- Since:
- MicroStrategy Web 8.0.0
-
getDefaultLocale
public java.util.Locale getDefaultLocale()
Returns default locale of this exception.- Specified by:
getDefaultLocale
in interfaceLocalizableException
- Returns:
- default locale of this exception.
- Since:
- MicroStrategy Web 8.0.0
-
setDefaultLocale
public void setDefaultLocale(java.util.Locale locale)
Sets the default locale of this exception.- Specified by:
setDefaultLocale
in interfaceLocalizableException
- Parameters:
locale
- new default locale- Since:
- MicroStrategy Web 8.0.0
-
setXMLHandler
public void setXMLHandler(MSTRCheckedException.ExceptionXMLHandler handler)
In some special scenarios, the message returned by the Intelligence Server is in XML form. Setting a handler allows the message to be parsed into something more meaningful. This only affects the output of the following methods:getMessage()
, andgetMessage(Locale)
.- Parameters:
handler
- XML handler- Since:
- MicroStrategy Web 9.0.0
-
getMessage
public java.lang.String getMessage(boolean useXMLHandler)
In some special scenarios, the message returned by the Intelligence Server is in XML form. This method governs whethersetXMLHandler(ExceptionXMLHandler)
should be used or bypassed.- Parameters:
useXMLHandler
- whether to bypasssetXMLHandler(ExceptionXMLHandler)
- Returns:
- the underlying message
- Since:
- MicroStrategy Web 9.0.0
-
-