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

Include rate limit data in ApiLimitExceededException #327

Open
wants to merge 6 commits into
base: 4.9
Choose a base branch
from

Conversation

webignition
Copy link
Contributor

Overview
A 429 (api limit exceeded) response includes headers reflecting the state of the rate limit. This state can be exposed by DigitalOceanV2\Exception\ApiLimitExceededException. Doing so allows callers to more easily access the rate limit state and act accordingly.

BC Concerns
This change adds a new third argument to the ApiLimitExceededException constructor. The new constructor argument is nullable and defaults to null to allow any existing calls to the constructor that may be present in consumers of this package to continue to work.

Tests
A new test has been added to verify that an instance of ApiLimitExceededException created via ExceptionThrower::handleRequest() contains the relevant rate limit state.

@webignition
Copy link
Contributor Author

webignition commented Sep 23, 2024

@GrahamCampbell How's this looking for merging?

edit: typo

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