Package dev.roanh.gmark.exception
Class GenerationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
dev.roanh.gmark.exception.GenerationException
- All Implemented Interfaces:
Serializable
Exception thrown when something goes wrong when
randomly generating something.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Runnable interface that can throw exceptions. -
Field Summary
-
Constructor Summary
ConstructorDescriptionGenerationException
(String reason) Constructs a new generation exception with the given reason.GenerationException
(String reason, Throwable cause) Constructs a new generation exception with the given reason and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic final void
Executes the given runnable and rethrows any exception it throws as a newGenerationException(java.lang.String, java.lang.Throwable)
.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial ID.- See Also:
-
-
Constructor Details
-
GenerationException
Constructs a new generation exception with the given reason.- Parameters:
reason
- The exception reason.
-
GenerationException
Constructs a new generation exception with the given reason and cause.- Parameters:
reason
- The exception reason.cause
- The original exception.
-
-
Method Details
-
rethrow
public static final void rethrow(GenerationException.GenerationRunnable runnable) throws GenerationException Executes the given runnable and rethrows any exception it throws as a newGenerationException(java.lang.String, java.lang.Throwable)
.- Parameters:
runnable
- The runnable to execute.- Throws:
GenerationException
- The rethrown exception if executing the runnable threw an exception.
-