Class ErrorMessage

    • Constructor Detail

      • ErrorMessage

        public ErrorMessage​(int errorCode,
                            Throwable exception,
                            String path)
        Creates a new ErrorMessage instance.
        Parameters:
        errorCode - the error code.
        exception - the error exception cause.
        path - the uri relative path.
      • ErrorMessage

        public ErrorMessage​(int errorCode,
                            String message,
                            Throwable exception,
                            String path)
        Creates a new ErrorMessage instance.
        Parameters:
        errorCode - the error code.
        message - the error message.
        exception - the error exception cause.
        path - the uri relative path.
      • ErrorMessage

        public ErrorMessage​(int errorCode,
                            String message,
                            String path)
        Creates a new ErrorMessage instance.
        Parameters:
        errorCode - the error code.
        message - the error message.
        path - the uri relative path.
      • ErrorMessage

        public ErrorMessage​(int errorCode,
                            String message,
                            String exception,
                            String path)
        Creates a new ErrorMessage instance.
        Parameters:
        errorCode - the error code.
        message - the error message.
        exception - the error exception cause.
        path - the uri relative path.
    • Method Detail

      • getErrorCode

        public int getErrorCode()
      • getMessage

        public String getMessage()
      • getException

        public String getException()
      • getPath

        public String getPath()
      • of

        public static ErrorMessage of​(Throwable exception,
                                      String path)
        Static helper method for mapping an given exception to a new ErrorMessage.
        Parameters:
        exception - the exception.
        path - the rest call path.
        Returns:
        the ErrorMessage; cannot return null.