Skip to content

Conversation

@NaluTripician
Copy link
Contributor

Pull Request Template

Description

This pull request introduces a new mechanism for injecting custom server errors with arbitrary status and substatus codes into the Cosmos DB Fault Injection framework. It adds builder and result classes for defining and applying custom server error rules, and updates the main interceptor logic to support these rules for both direct (StoreResponse) and gateway (HttpResponseMessage) modes.

The most important changes are:

Custom Server Error Injection Support:

  • Added a new FaultInjectionCustomServerErrorResult class to represent custom server errors with configurable status code, substatus code, delay, suppression, and injection rate. This is intended for internal testing only.
  • Introduced FaultInjectionCustomServerErrorResultBuilder to simplify the creation and configuration of custom server error results, including validation and fluent API for setting options.
  • Added FaultInjectionCustomServerErrorResultInternal to handle the internal logic for applying custom server errors, including generating the appropriate response objects for both direct and gateway modes.

Interceptor Logic Updates:

  • Updated ChaosInterceptor to check for and apply custom server error rules before standard server error rules for both direct and gateway request paths. This ensures that custom error rules take precedence when present. [1] [2]

Type of change

Please delete options that are not relevant.

  • [] New feature (non-breaking change which adds functionality)

Closing issues

To automatically close an issue: closes #IssueNumber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant