Class SpringAIErrorMapper
java.lang.Object
com.google.adk.models.springai.error.SpringAIErrorMapper
Maps Spring AI exceptions to appropriate ADK exceptions and error handling strategies.
This class provides:
- Exception classification and mapping
- Retry strategy recommendations
- Error message normalization
- Rate limiting detection
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumError categories for different types of failures.static classContainer for mapped error information.static enumRetry strategy recommendations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longgetRetryDelay(SpringAIErrorMapper.RetryStrategy strategy, int attempt) Gets the recommended delay before retrying based on the retry strategy.static booleanisRetryable(SpringAIErrorMapper.ErrorCategory category) Determines if an error is retryable based on its category.Maps a Spring AI exception to an error category and retry strategy.
-
Constructor Details
-
SpringAIErrorMapper
public SpringAIErrorMapper()
-
-
Method Details
-
mapError
Maps a Spring AI exception to an error category and retry strategy.- Parameters:
exception- the Spring AI exception- Returns:
- mapped error information
-
isRetryable
Determines if an error is retryable based on its category.- Parameters:
category- the error category- Returns:
- true if the error is potentially retryable
-
getRetryDelay
Gets the recommended delay before retrying based on the retry strategy.- Parameters:
strategy- the retry strategyattempt- the retry attempt number (0-based)- Returns:
- delay in milliseconds
-