public class

MSTRCheckedException

extends Exception
implements LocalizableException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ com.microstrategy.utils.MSTRCheckedException
Known Direct Subclasses
Known Indirect Subclasses

Summary

Nested Classes
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. 
Public Constructors
MSTRCheckedException(LocalizableMessage errorMsg)
Constructor.
MSTRCheckedException(LocalizableMessage errorMsg, Throwable e)
Constructor.
MSTRCheckedException(int code, Object[] params, Locale locale)
This constructor is deprecated. use other constructor instead
MSTRCheckedException(int code, Object[] params, Throwable e, Locale locale)
This constructor is deprecated. use other constructor instead
MSTRCheckedException()
Constructor.
MSTRCheckedException(String errorMsg)
Constructor.
MSTRCheckedException(int errorCode)
This constructor is deprecated. use other constructor instead
MSTRCheckedException(String errorMsg, int errorCode)
Constructor.
MSTRCheckedException(String errorMsg, int errorCode, Throwable e)
Constructor.
MSTRCheckedException(Throwable e)
Constructor.
Public Methods
Throwable getCause()
Retrieves the embedded throwable (or null if none).
Locale getDefaultLocale()
Returns default locale of this exception.
int getErrorCode()
Returns the error code associated with the given error.
LocalizableMessage getLocalizableMessage()
Returns LocalizableMessage object of this exception.
String getMessage(Locale locale)
Returns localized error message of this exception.
String getMessage(boolean useXMLHandler)
In some special scenarios, the message returned by the Intelligence Server is in XML form.
String getMessage()
Returns the error message.
Throwable getRootCause()
Follows the getCause chain to get the root cause.
static Throwable getRootCause(Throwable e)
void setCause(Throwable e)
Set the embedded error
void setDefaultLocale(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.
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object
From interface com.microstrategy.utils.LocalizableException

Public Constructors

public MSTRCheckedException (LocalizableMessage errorMsg)

Constructor.

Parameters
errorMsg The error message for this exception.

public MSTRCheckedException (LocalizableMessage errorMsg, Throwable e)

Constructor.

Parameters
errorMsg The error message for this exception.
e The embedded error object.

public MSTRCheckedException (int code, Object[] params, Locale locale)

This constructor is deprecated.
use other constructor instead

Constructor.

Parameters
code error code.
params The parameters required to constructing the error message based on error code.
locale The locale to localize this exception.

public MSTRCheckedException (int code, Object[] params, Throwable e, Locale locale)

This constructor is deprecated.
use other constructor instead

Constructor.

Parameters
code error code.
params The parameters required to constructing the error message based on error code.
e The embedded error.
locale The locale to localize this exception.

public MSTRCheckedException ()

Constructor.

public MSTRCheckedException (String errorMsg)

Constructor.

Parameters
errorMsg The error message for this exception.

public MSTRCheckedException (int errorCode)

This constructor is deprecated.
use other constructor instead

Constructor.

Parameters
errorCode The error code for this exception.

public MSTRCheckedException (String errorMsg, int errorCode)

Constructor.

Parameters
errorMsg The error message for this exception.
errorCode The error code for this exception.

public MSTRCheckedException (String errorMsg, int errorCode, Throwable e)

Constructor.

Parameters
errorMsg The error message for this exception.
errorCode The error code for this exception.
e The embedded error.

public MSTRCheckedException (Throwable e)

Constructor.

Parameters
e The embedded error.

Public Methods

public Throwable getCause ()

Retrieves the embedded throwable (or null if none).

Returns
  • The embedded throwable.

public Locale getDefaultLocale ()

Returns default locale of this exception.

Returns
  • default locale of this exception.

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 exception getCause(), 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.

Returns
  • The error code for the given error.

public LocalizableMessage getLocalizableMessage ()

Returns LocalizableMessage object of this exception. If this exception does not have a message but the embedded error has one, the one from embedded will return.

Returns

public String getMessage (Locale locale)

Returns localized error message of this exception.

Parameters
locale locale
Returns
  • Localized error message.

public String getMessage (boolean useXMLHandler)

In some special scenarios, the message returned by the Intelligence Server is in XML form. This method governs whether setXMLHandler(ExceptionXMLHandler) should be used or bypassed.

Parameters
useXMLHandler whether to bypass setXMLHandler(ExceptionXMLHandler)
Returns
  • the underlying message

public 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 exception getCause(), 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.

Returns
  • The error message.

public Throwable getRootCause ()

Follows the getCause chain to get the root cause.

public static Throwable getRootCause (Throwable e)

public void setCause (Throwable e)

Set the embedded error

Parameters
e The embedded error

public void setDefaultLocale (Locale locale)

Sets the default locale of this exception.

Parameters
locale new default locale

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(), and getMessage(Locale).

Parameters
handler XML handler