java.lang.Object
java.lang.Throwable
java.lang.Exception
com.github.sttk.exception.ReasonedException
- All Implemented Interfaces:
Serializable
Is the exception class that has a
Record
object indicating the
reason why this exception occurs.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionReasonedException
(Record reason) Is the constructor which takes aRecord
object indicating the reason for this excpetion.ReasonedException
(Record reason, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionGets the reason for this exception.Creats aRuntimeReasonedException
object for methods that cannot throw aReasonedException
.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ReasonedException
Is the constructor which takes aRecord
object indicating the reason for this excpetion.- Parameters:
reason
- A reason for this exception.
-
ReasonedException
Is the constructor which takes aRecord
object indicating the reason andThrowable
object indicating the cause for this excpetion.- Parameters:
reason
- A reason for this exception.cause
- A cause for this exception.
-
-
Method Details
-
getReason
Gets the reason for this exception.- Returns:
- The reason for this exception.
-
getMessage
- Overrides:
getMessage
in classThrowable
-
toRuntimeException
Creats aRuntimeReasonedException
object for methods that cannot throw aReasonedException
.- Returns:
- A
RuntimeReasonedException
object.
-