openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.75k stars 491 forks source link

getErrorCode(): Return value must be of type ?string, int returned #151

Closed KevinFairbanks closed 1 year ago

KevinFairbanks commented 1 year ago

Upgraded to v0.6.2 and seeing this error frequently (3x in every 10-12 calls)

TypeError: OpenAI\Exceptions\ErrorException::getErrorCode(): Return value must be of type ?string, int returned in /home/app/my.app/vendor/openai-php/client/src/Exceptions/ErrorException.php:48

hakkikonu commented 1 year ago

same error while usingimages()->create

gehrisandro commented 1 year ago

According to the OpenAI documentation this should always be a string: https://github.com/openai/openai-openapi/blob/ec0b3953bfa08a92782bdccf34c1931b13402f56/openapi.yaml#L1591

Can you provide a sample request which leads to a numeric error code?

gehrisandro commented 1 year ago

Closed due to inactivity. Please reopen if this is still an issue for you.