client icon indicating copy to clipboard operation
client copied to clipboard

Added API error separation by their HTTP codes

Open LuckThemAll opened this issue 1 year ago • 3 comments

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

LuckThemAll avatar Jun 30 '24 09:06 LuckThemAll

Marking as draft due to test failures & conflicts. Sorry for delay.

iBotPeaches avatar Apr 08 '25 23:04 iBotPeaches

@iBotPeaches is this something you'd accept if I resubmit the PR?

bytestream avatar Apr 09 '25 13:04 bytestream

@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.

iBotPeaches avatar Apr 09 '25 13:04 iBotPeaches