Class RichRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- africa.absa.inception.core.exception.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 Summary
Constructors Constructor Description RichRuntimeException()Constructs a new RichRuntimeException with null as its message.RichRuntimeException(String message)Constructs a new RichRuntimeException with the specified message.RichRuntimeException(String code, String message)Constructs a new RichRuntimeException with the specified code and message.RichRuntimeException(String code, String message, Throwable cause)Constructs a new RichRuntimeException with the specified code, message and cause.RichRuntimeException(String message, Throwable cause)Constructs a new RichRuntimeException with the specified message and cause.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).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCode()Returns the optional error code or NONE if no error code was specified.LocalDateTimegetWhen()Returns the date and time the exception occurred.StringgetWhenAsString()Returns the date and time the exception occurred as a String.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
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 codemessage- 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() methodcause- 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 codemessage- the message saved for later retrieval by the getMessage() methodcause- 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
-
-