Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACNA-961 | add cosmosDB 429 custom error handling #82

Merged
merged 4 commits into from
Sep 5, 2022

Conversation

arjuncooliitr
Copy link
Contributor

@arjuncooliitr arjuncooliitr commented Aug 16, 2022

Description

This PR is to wrap the internal cosmosDB 429 error (thrown when more RUs are consumed than provisioned) and throw documented customized error known by state lib.

Related Issue

#58

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #82 (c471f13) into master (f34b2af) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master       #82   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          164       167    +3     
  Branches        32        33    +1     
=========================================
+ Hits           164       167    +3     
Impacted Files Coverage Δ
lib/StateStoreError.js 100.00% <100.00%> (ø)
lib/impl/CosmosStateStore.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -58,6 +59,7 @@ E('ERROR_BAD_ARGUMENT', '%s')
E('ERROR_NOT_IMPLEMENTED', 'method `%s` not implemented')
E('ERROR_BAD_CREDENTIALS', 'cannot access %s, make sure your credentials are valid')
E('ERROR_PAYLOAD_TOO_LARGE', 'key, value or request payload is too large')
E('ERROR_DB_RATE_LIMITED', 'db access requests rate limited')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change this to following
E('ERROR_REQUEST_RATE_TOO_HIGH', 'Request rate too high. Please retry after sometime.')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this looks much better error code and message to be exposed to the user. I'll make the changes.

@arjuncooliitr arjuncooliitr marked this pull request as ready for review August 17, 2022 13:03
Copy link
Member

@moritzraho moritzraho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@MichaelGoberling MichaelGoberling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arjuncooliitr arjuncooliitr merged commit a405c22 into adobe:master Sep 5, 2022
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.

4 participants