Class RichException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- africa.absa.inception.core.exception.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 Summary
Constructors Constructor Description RichException()Constructs a new RichException with null as its message.RichException(String message)Constructs a new RichException with the specified message.RichException(String code, String message)Constructs a new RichException with the specified code and message.RichException(String code, String message, Throwable cause)Constructs a new RichException with the specified code, message and cause.RichException(String message, Throwable cause)Constructs a new RichException with the specified message and cause.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).
-
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
-
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 codemessage- 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() methodcause- 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 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
-
-