Skip to content

[Bug]: Fail gracefully on unsuccessful request #479

@NoxArt

Description

@NoxArt

Description

If the request fails, this line will simply crash on "Call to a member function getBody() on null" instead of handling this usecase somehow - at least to convert it to a semantic exception e.g. RequestFailedException or something

Thank you

Steps To Reproduce

Make a request that will somehow fail, maybe towards non-existing endpoint?

For us it fails during Files->Download

It may be related to response "The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.co..."

OpenAI PHP Client Version

v0.10.1

PHP Version

8.1.27

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions