Added API error separation by their HTTP codes
What:
- [ ] Bug Fix
- [x] New Feature
Description:
Added separation of API errors by their HTTP codes. This enhancement improves error handling by categorizing errors based on their HTTP status codes, allowing for more precise error management and debugging.
Related:
https://github.com/openai-php/client/issues/402
Marking as draft due to test failures & conflicts. Sorry for delay.
@iBotPeaches is this something you'd accept if I resubmit the PR?
@bytestream - You like hitting me with all the Exception related ones :) - A bit torn on this one because this library is used for so many more services than just OpenAI and it seems to make some large assumptions on HTTP code and introduce a lot more exceptions.
I think for me the improvements to make are:
- stop crashing when throwing an exception
- include the response in the existing relevant exceptions
Those are a bit easier in my head to accept.