Package com.tnsai.tools.spi
Class ToolRateLimitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.exceptions.TnsAIException
com.tnsai.tools.spi.ToolException
com.tnsai.tools.spi.ToolRateLimitException
- All Implemented Interfaces:
Serializable
Tool was rate-limited by upstream — typically HTTP 429. Retryable, and
carries the upstream-suggested
retry-after when available so
the resilience layer can honor the wait instead of hammering the API
back into the rate-limit window.- Since:
- 0.5.0 (issue #88)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tnsai.tools.spi.ToolException
ToolException.Builder, ToolException.ErrorType -
Constructor Summary
ConstructorsConstructorDescriptionToolRateLimitException(String toolName, Duration retryAfter) ToolRateLimitException(String toolName, Duration retryAfter, Integer remainingBudget) -
Method Summary
Modifier and TypeMethodDescriptionGets the error code for this exception type.longGets suggested retry delay in milliseconds.Methods inherited from class com.tnsai.tools.spi.ToolException
apiError, builder, configurationError, getAttribute, getAttributes, getDetailedMessage, getErrorType, getHttpStatusCode, getQuery, getTimestamp, getToolName, isRetryable, networkError, parseError, timeout, toString, validationErrorMethods inherited from class com.tnsai.exceptions.TnsAIException
getContext, getMaxRetryAttempts, getMessage, getThrownAt, wrapMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ToolRateLimitException
-
ToolRateLimitException
-
-
Method Details
-
getRetryAfter
-
getRemainingBudget
-
getSuggestedRetryDelayMs
public long getSuggestedRetryDelayMs()Description copied from class:TnsAIExceptionGets suggested retry delay in milliseconds. Override in subclasses for specific retry strategies.- Overrides:
getSuggestedRetryDelayMsin classTnsAIException
-
getErrorCode
Description copied from class:TnsAIExceptionGets the error code for this exception type. Format: TNSAI-XXX where XXX is derived from class name.- Overrides:
getErrorCodein classTnsAIException
-