Skip to main content
Version: 4

Error handler

Adeptia introduces the following configuration within the Open API extensions to specify the error handler configuration for managing the API Response. This configuration enables Adeptia to handle errors in API responses, specifying the maximum number of retries, conditions triggering retries, and the retry strategy to use. 

Below is a sample error handler configuration in YAML format:

Where,

  • maxRetries: Specifies the maximum number of retries allowed for handling errors. In this case, it is set to 5.

  • responseFilter: Defines conditions for handling specific HTTP response status codes. In this configuration:

    • statusCode: Specifies the HTTP status code(s) that trigger the defined action. Multiple comma-separated status codes can be specified.

    • action: Specifies the action to be taken upon encountering the specified status code. Here, if the status code is 429 (Too Many Requests), the action is set to RETRY.

    • retryStrategy: Specifies the retry strategy to be used when retrying. In this case, it is set to 'ConstantBackoff'.

  • retryStrategies: Defines different retry strategies that can be used. In this configuration, there is one defined strategy named 'ConstantBackoff':

    • backoffTimeInSeconds: Specifies the duration (in seconds) for which the system waits before retrying the operation. Here, it is set to 5 seconds.
InformationCurrently, only the RETRY action and the ConstantBackoff retry strategies are supported.