Class RichException

  • All Implemented Interfaces:
    Serializable

    public class RichException
    extends Exception
    The RichException exception is thrown when additional information related to an error condition exists including the time the error occurred and an associated error code. condition.
    Author:
    Marcus Portmann
    See Also:
    Serialized Form
    • Constructor Detail

      • RichException

        public RichException()
        Constructs a new RichException with null as its message.
      • RichException

        public RichException​(String message)
        Constructs a new RichException with the specified message.
        Parameters:
        message - the message saved for later retrieval by the getMessage() method
      • RichException

        public RichException​(Throwable cause)
        Constructs a new RichException with the specified cause and a message of (cause==null ? null : cause.toString()) (which typically contains the class and message of cause).
        Parameters:
        cause - The cause saved for later retrieval by the getCause() method. (A null value is permitted if the cause is nonexistent or unknown)
      • RichException

        public RichException​(String code,
                             String message)
        Constructs a new RichException with the specified code and message.
        Parameters:
        code - the error code
        message - the message saved for later retrieval by the getMessage() method
      • RichException

        public RichException​(String message,
                             Throwable cause)
        Constructs a new RichException with the specified message and cause.
        Parameters:
        message - the message saved for later retrieval by the getMessage() method
        cause - The cause saved for later retrieval by the getCause() method. (A null value is permitted if the cause is nonexistent or unknown)
      • RichException

        public RichException​(String code,
                             String message,
                             Throwable cause)
        Constructs a new RichException with the specified code, message and cause.
        Parameters:
        code - the error code
        message - the message saved for later retrieval by the getMessage() method
        cause - The cause saved for later retrieval by the getCause() method. (A null value is permitted if the cause is nonexistent or unknown)
    • Method Detail

      • getCode

        public String getCode()
        Returns the optional error code or NONE if no error code was specified.
        Returns:
        the optional error code or NONE if no error code was specified
      • getWhen

        public LocalDateTime getWhen()
        Returns the date and time the exception occurred.
        Returns:
        the date and time the exception occurred
      • getWhenAsString

        public String getWhenAsString()
        Returns the date and time the exception occurred as a String.
        Returns:
        the date and time the exception occurred as a String