Class ExceptionUtils


  • public class ExceptionUtils
    extends java.lang.Object
    The type Exception utils.
    • Method Detail

      • newDataSourceException

        public static DataSourceException newDataSourceException​(java.lang.Object caller,
                                                                 int errorCode,
                                                                 java.lang.String... parameters)
        New data source exception data source exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        parameters - the parameters
        Returns:
        the data source exception
      • newDataSourceException

        public static DataSourceException newDataSourceException​(java.lang.Object caller,
                                                                 int errorCode,
                                                                 java.lang.Throwable cause,
                                                                 java.lang.String... parameters)
        New data source exception data source exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        cause - the cause
        parameters - the parameters
        Returns:
        the data source exception
      • newNotImplementedException

        public static NotImplementedException newNotImplementedException​(java.lang.Object caller,
                                                                         int errorCode,
                                                                         java.lang.String... parameters)
        New not implemented exception not implemented exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        parameters - the parameters
        Returns:
        the not implemented exception
      • newNotImplementedException

        public static NotImplementedException newNotImplementedException​(java.lang.Object caller,
                                                                         int errorCode,
                                                                         java.lang.Throwable cause,
                                                                         java.lang.String... parameters)
        New not implemented exception not implemented exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        cause - the cause
        parameters - the parameters
        Returns:
        the not implemented exception
      • newNullArgumentException

        public static NullArgumentException newNullArgumentException​(java.lang.Object caller,
                                                                     int errorCode,
                                                                     java.lang.String... parameters)
        New null argument exception null argument exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        parameters - the parameters
        Returns:
        the null argument exception
      • newNullArgumentException

        public static NullArgumentException newNullArgumentException​(java.lang.Object caller,
                                                                     int errorCode,
                                                                     java.lang.Throwable cause,
                                                                     java.lang.String... parameters)
        New null argument exception null argument exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        cause - the cause
        parameters - the parameters
        Returns:
        the null argument exception
      • newPluginException

        public static PluginException newPluginException​(java.lang.Object caller,
                                                         int errorCode,
                                                         java.lang.String... parameters)
        New plugin exception plugin exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        parameters - the parameters
        Returns:
        the plugin exception
      • newPluginException

        public static PluginException newPluginException​(java.lang.Object caller,
                                                         int errorCode,
                                                         java.lang.Throwable cause,
                                                         java.lang.String... parameters)
        New plugin exception plugin exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        cause - the cause
        parameters - the parameters
        Returns:
        the plugin exception
      • newEntityManagerException

        public static EntityManagerException newEntityManagerException​(java.lang.Object caller,
                                                                       int errorCode,
                                                                       java.lang.String... parameters)
        New entity manager exception entity manager exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        parameters - the parameters
        Returns:
        the entity manager exception
      • newEntityManagerException

        public static EntityManagerException newEntityManagerException​(java.lang.Object caller,
                                                                       int errorCode,
                                                                       java.lang.Throwable cause,
                                                                       java.lang.String... parameters)
        New entity manager exception entity manager exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        cause - the cause
        parameters - the parameters
        Returns:
        the entity manager exception
      • newConnectorException

        public static ConnectorException newConnectorException​(java.lang.Object caller,
                                                               int errorCode,
                                                               java.lang.String... parameters)
        New connector exception connector exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        parameters - the parameters
        Returns:
        the connector exception
      • newConnectorException

        public static ConnectorException newConnectorException​(java.lang.Object caller,
                                                               int errorCode,
                                                               java.lang.Throwable cause,
                                                               java.lang.String... parameters)
        New connector exception connector exception.
        Parameters:
        caller - the caller
        errorCode - the error code
        cause - the cause
        parameters - the parameters
        Returns:
        the connector exception
      • logMessage

        public static void logMessage​(java.lang.Exception e,
                                      org.slf4j.Logger logger,
                                      Tracer tracer)
        Log message.
        Parameters:
        e - the e
        logger - the logger
        tracer - the tracer
      • createErrorCode

        public static int createErrorCode​(int partnerNo,
                                          int moduleNo,
                                          int errorNo)
        Create error code int.
        Parameters:
        partnerNo - the partner no
        moduleNo - the module no
        errorNo - the error no
        Returns:
        the int
      • getErrorCodeManager

        public static ErrorCodeManagerLocal getErrorCodeManager()
        Gets error code manager.
        Returns:
        the error code manager
      • readErrorMessage

        public static java.lang.String readErrorMessage​(int code,
                                                        java.lang.String language,
                                                        java.lang.String... parameters)
        Read error message string.
        Parameters:
        code - the code
        language - the language
        parameters - the parameters
        Returns:
        the string
      • readErrorCodeInfo

        public static ErrorCodeInfo readErrorCodeInfo​(int code,
                                                      java.lang.String language)
        Read error code info based on code and language.
        Parameters:
        code - the code
        language - the language
        Returns:
        the error code info
      • retrieveExceptionsStack

        public static java.util.List<ErrorStackInfo> retrieveExceptionsStack​(java.lang.Exception exception)
        Prepares list of ErrorStackInfo objects, this method returns all errors from error's stack.
        Parameters:
        exception - the exception
        Returns:
        list