Class MSTRUncheckedException

    • Constructor Detail

      • MSTRUncheckedException

        public MSTRUncheckedException​(LocalizableMessage errorMsg)
        Constructor.
        Parameters:
        errorMsg - The error message for this exception.
        Since:
        MicroStrategy Web 8.0.0
      • MSTRUncheckedException

        public MSTRUncheckedException​(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
      • MSTRUncheckedException

        public MSTRUncheckedException​(int code,
                                      java.lang.Object[] params,
                                      java.util.Locale locale)
        Deprecated.
        use other constructor instead
        Constructor.
        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
      • MSTRUncheckedException

        public MSTRUncheckedException​(int code,
                                      java.lang.Object[] params,
                                      java.lang.Throwable e,
                                      java.util.Locale locale)
        Deprecated.
        use other constructor instead
        Constructor.
        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
      • MSTRUncheckedException

        public MSTRUncheckedException()
        Constructor.
      • MSTRUncheckedException

        public MSTRUncheckedException​(java.lang.String errorMsg)
        Constructor.
        Parameters:
        errorMsg - The error message for this exception.
      • MSTRUncheckedException

        public MSTRUncheckedException​(int errorCode)
        Deprecated.
        use other constructor instead
        Constructor.
        Parameters:
        errorCode - The error code for this exception.
      • MSTRUncheckedException

        public MSTRUncheckedException​(java.lang.String errorMsg,
                                      int errorCode)
        Constructor.
        Parameters:
        errorCode - The error code for this exception.
        errorMsg - The error message for this exception.
      • MSTRUncheckedException

        public MSTRUncheckedException​(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.
      • MSTRUncheckedException

        public MSTRUncheckedException​(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 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.
        Specified by:
        getErrorCode in interface LocalizableException
        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 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.
        Specified by:
        getMessage in interface LocalizableException
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        The error message.
      • getMessage

        public java.lang.String getMessage​(java.util.Locale locale)
        Specified by:
        getMessage in interface LocalizableException
        Since:
        MicroStrategy Web 8.0.0
      • getCause

        public java.lang.Throwable getCause()
        Retrieves the embedded throwable (or null if none).
        Overrides:
        getCause in class java.lang.Throwable
        Returns:
        The embedded throwable.
      • getRootCause

        public java.lang.Throwable getRootCause()
      • setCause

        public void setCause​(java.lang.Throwable e)
        Set the embedded error
        Parameters:
        e - The embedded error
      • getDefaultLocale

        public java.util.Locale getDefaultLocale()
        Returns default locale of this exception.
        Specified by:
        getDefaultLocale in interface LocalizableException
        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 interface LocalizableException
        Parameters:
        locale - new default locale
        Since:
        MicroStrategy Web 8.0.0