Class RichRuntimeException

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    XmlParserException

    public class RichRuntimeException
    extends RuntimeException
    The RichRuntimeException 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

      • RichRuntimeException

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

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

        public RichRuntimeException​(Throwable cause)
        Constructs a new RichRuntimeException 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)
      • RichRuntimeException

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

        public RichRuntimeException​(String message,
                                    Throwable cause)
        Constructs a new RichRuntimeException 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)
      • RichRuntimeException

        public RichRuntimeException​(String code,
                                    String message,
                                    Throwable cause)
        Constructs a new RichRuntimeException 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