Skip to content

chore: add more detailed api exceptions #163

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

Merged
merged 1 commit into from
Apr 11, 2023
Merged

Conversation

aallam
Copy link
Owner

@aallam aallam commented Apr 10, 2023

Q A
Bug fix? rno
New feature? yes/no
BC breaks? no
Related Issue Fix #159

Describe your change

Add more detailed exceptions for API errors to the sealed class OpenAIAPIException:

  • RateLimitException: represents an exception thrown when the rate limit is exceeded
  • InvalidRequestException: represents an exception thrown when an invalid request is made
  • AuthenticationException: represents an exception thrown when an authentication error occurs
  • PermissionException: represents an exception thrown when a permission error occurs
  • UnknownAPIException : represents an exception thrown when an unknown error occurs, rhis exception is used when the specific type of error is not covered by the existing subclasses.

@aallam aallam merged commit 3c54b63 into main Apr 11, 2023
@aallam aallam deleted the chore/detailed-api-errors branch April 11, 2023 05:59
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.

Better representations of API errors
1 participant