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

Catch all API error codes #7

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Catch all API error codes #7

merged 2 commits into from
Nov 22, 2024

Conversation

aaronfriedman6
Copy link
Contributor

@aaronfriedman6 aaronfriedman6 commented Nov 21, 2024

To avoid having to update the code for each new error code, we will catch all of them and only throw an error when the API limit has been hit or the server cannot be reached. This is because the other error codes are usually request-specific errors and should not prevent the code from continuing to send new requests with different parameters. Also added tuple unpacking for improved readability.

@aaronfriedman6 aaronfriedman6 changed the title Catch all XML errors Catch all API error codes Nov 21, 2024
Copy link

@fatimarahman fatimarahman left a comment

Choose a reason for hiding this comment

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

Looks great!

@fatimarahman
Copy link

Nit: Update nypl-py-utils to version 1.5 in both requirements files

@aaronfriedman6 aaronfriedman6 merged commit d61d199 into main Nov 22, 2024
2 checks passed
@aaronfriedman6 aaronfriedman6 deleted the catch-all-errors branch November 22, 2024 16:45
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.

2 participants