-
-
Notifications
You must be signed in to change notification settings - Fork 667
chore(meta): rework exception handling #643
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
Conversation
|
thanks @bytestream! pinged a few coworkers to double check the work as well. |
|
@iBotPeaches I've just noticed that you can't access the headers on rate limited requests? I think |
good catch. I'll do that today/tomorrow |
What:
Description:
People have been complaining about phantom issues for awhile that parsers get strings, but expect objects. This has been reported a lot of times.
Folks have tried to fix this many times by either overhauling exceptions, detecting http status codes, introducing many new exceptions and all of this is not addressing the root problem.
A long time ago an issue was created to support audio transcription api (#59) and that endpoint has a powerhouse of a feature.
The endpoint can change its return to a variety of types. So base Response classes were adapted to support string/array to handle all of those. The problem however that every single other endpoint only supports json/array. So now that the base class supports a string (the other types) they can crash in odd situations - like when get an internal error (string) that is then expected to be handled by every single entity, when only Audio is prepped for it.
You'll probably get a 404 not found in pure text from some OpenAI load balancer at some point. At thousands of OpenAI calls a day we get roughly 0-3 of these errors every single day. Its an ugly error - its not a structured OpenAI return. Since the base classes support strings after #59 - it moves onward to any other non-audio class and crashes. This exception is ugly
Been reported for years. So I'm on a journey to resolve this at the root.
Steps
Related:
fixes #326
fixes #339
fixes #341
fixes #402
fixes #549
closes #553
closes #440
closes #429
closes #359