Class MiddlewareException

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    ClientException, ResourceNotFoundException, ServerException

    public class MiddlewareException
    extends RuntimeException
    Base class for middleware exceptions. Provides the support for returning error code and error message. Each middleware operation should define appropriate error codes to convey the meaning of the exception. This class mandates the error code parameter in all its constructors.
    Author:
    Feroz
    See Also:
    Serialized Form
    • Constructor Detail

      • MiddlewareException

        public MiddlewareException​(String errCode,
                                   String message)
        Initializes the middleware exception with a given error code and message.
        Parameters:
        errCode - Error code from the service
        message - Error message (static). For parameter substitution use the other constructor
      • MiddlewareException

        public MiddlewareException​(String errCode,
                                   String message,
                                   Object... params)
        Initializes the middleware exception with a template message
        Parameters:
        errCode - Error code from the service
        message - Error message, which conforms to the java.text.MessageFormat spec
        params - Parameters substituted in the message string
      • MiddlewareException

        public MiddlewareException​(String errCode,
                                   String message,
                                   Throwable root)
        Initializes the middleware exception with a template message
        Parameters:
        errCode - Error code from the service
        message - Error message
        root - Root cause exception
      • MiddlewareException

        public MiddlewareException​(String errCode,
                                   String message,
                                   Throwable root,
                                   Object... params)
        Initializes the middleware exception with a template message
        Parameters:
        errCode - Error code from the service
        root - Root cause of the exception
        message - Error message, which conforms to the java.text.MessageFormat spec
        params - Parameters substituted in the message string