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

Unclear how to handle 429 response from CRM #102

Open
JefRouleau opened this issue Sep 25, 2020 · 2 comments
Open

Unclear how to handle 429 response from CRM #102

JefRouleau opened this issue Sep 25, 2020 · 2 comments

Comments

@JefRouleau
Copy link

It is unclear how best to handle a 429 from CRM. The CRMWebAPIException does not give access to the status code. Even if it did, we would be missing the RetryAfter header. Ideally it would be handled by the library or at least it could be exposed. Maybe a quick fix would be to add the HTTP status code in the exception?

This is somewhat related to #86 but I'm not necessarily looking for integration with Polly.
Also, I currently don't see the retries being handled in PR #99 mentioned by the issue #86 .

@gregwinterstein
Copy link

I'm not sure it helps you much, but we use the attached modification to CRMWebAPI.cs to add the status code and the URL to the exception messages.

patch.diff.txt

@mohsinonxrm
Copy link

@JefRouleau , PR #99 has a basic version of Polly WaitAndRetry implemented. Take a look here:
https://github.com/davidyack/Xrm.Tools.CRMWebAPI/pull/99/files#diff-1bf3a747e4682ee05a1619771c4d291a27b4e56a6a049704ec0fdd2a76311deb
Look at line: 123 from CRMWebAPI.cs

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

No branches or pull requests

3 participants