Skip to content

fix: CosmosException's statusCode not correct when 429 in batchExecute#85

Merged
thunderz99 merged 2 commits into
masterfrom
fix/cosmos-exception-status-code-not-correct-when-429-in-batch
Jun 14, 2024
Merged

fix: CosmosException's statusCode not correct when 429 in batchExecute#85
thunderz99 merged 2 commits into
masterfrom
fix/cosmos-exception-status-code-not-correct-when-429-in-batch

Conversation

@thunderz99
Copy link
Copy Markdown
Owner

@thunderz99 thunderz99 commented Jun 14, 2024

Current

When batchExecute fails 10 times due to a 429 status code, a CosmosException with status code 0 will be thrown. This makes it difficult for programs calling batchExecute to catch this exception and correctly identify the status code.

Expectation

A CosmosException with status code 429 (the same as the root cause's status code) should be thrown. This way, the caller can catch the exception and obtain a reasonable status code for further processing.

Way to Fix

Modify the status code of the thrown CosmosException and add a corresponding unit test.

@thunderz99 thunderz99 merged commit 97ba968 into master Jun 14, 2024
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