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

Make status code available in APIError #50

Conversation

lzell
Copy link
Contributor

@lzell lzell commented Jun 23, 2024

  • Developers may want to build custom UI around specific status codes from the API. For example, a rate limit code is 429, which the end user may receive from either OpenAI or from AIProxy's per-user rate limiting logic. In this case, the developer may want to pop UI notifying the user why the request has failed.

  • This patch makes the status code available on the APIError.responseUnsuccessful case.

  • Added a usage example to the README

@jamesrochabrun jamesrochabrun merged commit 2092e73 into jamesrochabrun:main Jun 24, 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.

None yet

2 participants