# Class SpringAIErrorMapper

java.lang.Object
com.google.adk.models.springai.error.SpringAIErrorMapper

public class SpringAIErrorMapper extends Object
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 Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `SpringAIErrorMapper.ErrorCategory`
  Error categories for different types of failures.
  `static class`
  `SpringAIErrorMapper.MappedError`
  Container for mapped error information.
  `static enum`
  `SpringAIErrorMapper.RetryStrategy`
  Retry strategy recommendations.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SpringAIErrorMapper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static long`
  `getRetryDelay(SpringAIErrorMapper.RetryStrategy strategy, int attempt)`
  Gets the recommended delay before retrying based on the retry strategy.
  `static boolean`
  `isRetryable(SpringAIErrorMapper.ErrorCategory category)`
  Determines if an error is retryable based on its category.
  `static SpringAIErrorMapper.MappedError`
  `mapError(Throwable exception)`
  Maps a Spring AI exception to an error category and retry strategy.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SpringAIErrorMapper

    public SpringAIErrorMapper()

- ## Method Details

  - ### mapError

    public static SpringAIErrorMapper.MappedError mapError(Throwable exception)
    Maps a Spring AI exception to an error category and retry strategy.
    Parameters:
      `exception` - the Spring AI exception
    Returns:
      mapped error information

  - ### isRetryable

    public static boolean isRetryable(SpringAIErrorMapper.ErrorCategory category)
    Determines if an error is retryable based on its category.
    Parameters:
      `category` - the error category
    Returns:
      true if the error is potentially retryable

  - ### getRetryDelay

    public static long getRetryDelay(SpringAIErrorMapper.RetryStrategy strategy, int attempt)
    Gets the recommended delay before retrying based on the retry strategy.
    Parameters:
      `strategy` - the retry strategy
      `attempt` - the retry attempt number (0-based)
    Returns:
      delay in milliseconds