Package com.tnsai.state
Class StateException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.exceptions.TnsAIException
com.tnsai.state.StateException
- All Implemented Interfaces:
Serializable
Exception thrown when state operations fail.
This exception is thrown by checkpointer implementations when operations like save, load, or delete fail. It wraps the underlying cause (IO errors, serialization errors, etc.) with retry semantics.
Example scenarios:
- File system errors (disk full, permissions)
- Database connection failures
- Serialization/deserialization errors
- Network errors (Redis, remote storage)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStateException(String message) Creates a StateException with a message.StateException(String message, Throwable cause) Creates a StateException with a message and cause. -
Method Summary
Modifier and TypeMethodDescriptionintMaximum retry attempts for state operations.longSuggested retry delay for state operations.Methods inherited from class com.tnsai.exceptions.TnsAIException
getContext, getErrorCode, getMessage, getThrownAt, isRetryable, wrapMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
StateException
Creates a StateException with a message.- Parameters:
message- error message
-
StateException
Creates a StateException with a message and cause.- Parameters:
message- error messagecause- underlying cause
-
-
Method Details
-
getSuggestedRetryDelayMs
public long getSuggestedRetryDelayMs()Suggested retry delay for state operations.- Overrides:
getSuggestedRetryDelayMsin classTnsAIException- Returns:
- 500ms initial delay
-
getMaxRetryAttempts
public int getMaxRetryAttempts()Maximum retry attempts for state operations.- Overrides:
getMaxRetryAttemptsin classTnsAIException- Returns:
- 3 attempts
-