Class ErrorInfo

  • All Implemented Interfaces:
    ConfigurationElement, ConfigurationFile, java.lang.Cloneable

    public class ErrorInfo
    extends AbstractConfigurationElement
    This class is used by the application to change the title and message of the error, to indicate whether the error is expected by the iframe in the event of an iframe request, or to find the page to which the user is redirected when the error occurs.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Detail

      • ErrorInfo

        public ErrorInfo()
        Since:
        MicroStrategy Web 9.0.0
    • Method Detail

      • getKeyAttribute

        protected java.lang.String getKeyAttribute()
        Description copied from class: AbstractConfigurationElement
        This method must return the attribute that uniquely identifies this element among its siblings; if no single attribute can be used, return null and override the getKey and setKey methods.
        Specified by:
        getKeyAttribute in class AbstractConfigurationElement
        Since:
        MicroStrategy Web 9.0.0
      • getTitle

        public java.lang.String getTitle​(Messages messages)
        Returns the string to display as title for this error message. This string is the result of the concatenation of all the title nodes of this error. If a Messages instance is provided, the string will be localized using the strings bundle.
      • getMessage

        public java.lang.String getMessage​(Messages messages)
        Returns the string to display as Message for this error message. This string is the result of the concatenation of all the title nodes of this error. If a Messages instance is provided, the string will be localized using the strings bundle. TODO: Enhance this method to properly consider useOriginalMessage option. It should either take in the original message as an additional parameter, or potentially the Exception/error. However, the errors and exceptions don't always have a common parent or common way of retrieving the original message, so passing the original string would probably be best.
      • setMessageElement

        public void setMessageElement​(java.lang.Object key,
                                      ConfigurationElement child)
      • getErrorCode

        public int getErrorCode()
        The code identifies the error. This can be an error code from the Intelligence Server or a value from the EnumWebAppErrorCodes interface.
      • setErrorCode

        public void setErrorCode​(int errorCode)
        Set code that identifies the error. This can be an error code from the Intelligence Server or a value from the EnumWebAppErrorCodes interface.
        Since:
        MicroStrategy Web 9.0.0
      • getErrorType

        public int getErrorType()
        The error type identifies what information will be displayed in the error message. Possible values are: 1 - system error; 2 - user error. For system errors we display the title, info, and error message where the info looks like:

        Your request could not be processed due to a server error.
        Please try again. If the error persists, contact the server administrator.

        For user errors we skip the info part.

        Since:
        MicroStrategy Web 9.0.0
      • setErrorType

        public void setErrorType​(int errorType)
        Set error type
        Since:
        MicroStrategy Web 9.0.0
      • getTarget

        public java.lang.String getTarget()
        The target attribute indicates the page to which the user should be redirected when the error occurs. If a target is not specified (it's either null or an empty string, the execution continues on the same page.
      • setTarget

        public void setTarget​(java.lang.String target)
        Set the target page. The target indicates the page to which the user should be redirected when the error occurs. If a target is not specified (it's either null or an empty string, the execution continues on the same page.
        Since:
        MicroStrategy Web 9.0.0
      • showContactInfo

        public boolean showContactInfo()
        Returns whether the application should render the contact information (if available) from the Project Defaults page when error information is displayed to the user.
      • setShowContactInfo

        public void setShowContactInfo​(boolean value)
        Indicates whether the application should render the contact information (if available) from the Project Defaults page when error information is displayed to the user.
        Since:
        MicroStrategy Web 9.0.0
      • displayError

        public boolean displayError()
        Returns whether the application should render the title, message, and contact information when the error occurs.
      • setDisplayError

        public void setDisplayError​(boolean value)
        Indicates whether the application should render the title, message, and contact information when the error occurs.
        Since:
        MicroStrategy Web 9.0.0
      • useOriginalMessage

        public boolean useOriginalMessage()
        Returns whether the application should display the original error message returned by the error object. (This is the error message generated on the back-end.)
      • setUseOriginalMessage

        public void setUseOriginalMessage​(boolean value)
        Indicates whether the application should display the original error message returned by the error object. (This is the error message generated on the back-end.)
        Since:
        MicroStrategy Web 9.0.0
      • setAllowIframe

        public void setAllowIframe​(boolean value)
        Indicates whether this error condition can happened within an iFrame request for partial page update. If "false", even if it's an iframe-request, the whole page gets refreshed.
      • allowIframe

        public boolean allowIframe()
        Returns whether this error condition can happened within an iFrame request for partial page update. If "false", even if it's an iframe-request, the whole page gets refreshed.
      • getMessageList

        public AbstractConfigurationElement.FilteredList getMessageList()
        Returns the list of messages associated with this error. The error message displayed to the user will be the linear concatenation of these.
        Since:
        MicroStrategy Web 9.0.0
      • getTitleList

        public AbstractConfigurationElement.FilteredList getTitleList()
        Returns the list of titles to display for this error. The final title displayed to the user will be the linear concatenation of them.
        Since:
        MicroStrategy Web 9.0.0