Class FlowException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.github.juliengalet.reactorflow.exception.FlowException
-
- All Implemented Interfaces:
PrettyPrint,Serializable
- Direct Known Subclasses:
FlowBuilderException,FlowFunctionalException,FlowTechnicalException
public abstract class FlowException extends RuntimeException implements PrettyPrint
Abstract exception used to generate all types of exceptions used in this library. You can inherit this class to build custom exceptions if you want.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFlowException(String message)Construct an exception from a message.protectedFlowException(Throwable cause, String message)Construct an exception from a message and the originalThrowable.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description FlowExceptionflowConcerned(Flow<?> flowConcerned)Set theflowConcerned.Flow<?>getFlowConcerned()Get theflowConcerned.abstract FlowExceptionTypegetType()Abstract method that should be implemented, in order to know theFlowExceptionType.booleanisRecoverable(RecoverableFlowException recoverable)Check if the exception is recoverable or retryable, for aRecoverableFlowExceptiontype.StringtoPrettyString()Get the colorized string representation of the exception.StringtoString()Get the string representation of the exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
FlowException
protected FlowException(String message)
Construct an exception from a message.- Parameters:
message- The message
-
-
Method Detail
-
getType
public abstract FlowExceptionType getType()
Abstract method that should be implemented, in order to know theFlowExceptionType.- Returns:
- A
FlowExceptionType
-
flowConcerned
public FlowException flowConcerned(Flow<?> flowConcerned)
Set theflowConcerned.- Parameters:
flowConcerned- TheflowConcerned- Returns:
- The
FlowException
-
getFlowConcerned
public Flow<?> getFlowConcerned()
Get theflowConcerned.- Returns:
- A
Flowor null.
-
toString
public String toString()
Get the string representation of the exception.
-
toPrettyString
public String toPrettyString()
Get the colorized string representation of the exception.- Specified by:
toPrettyStringin interfacePrettyPrint- Returns:
- A
Stringrepresenting the exception
-
isRecoverable
public final boolean isRecoverable(RecoverableFlowException recoverable)
Check if the exception is recoverable or retryable, for aRecoverableFlowExceptiontype.- Parameters:
recoverable- ARecoverableFlowExceptiontype- Returns:
- A boolean
-
-