Skip to content
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

Exceptions should have more detailed information, like what was the RESPONSE text. #402

Open
pavelthq opened this issue May 24, 2024 · 2 comments

Comments

@pavelthq
Copy link

throw new UnserializableResponse($jsonException);

JsonException: Syntax error in /var/www/html/chatgpt/vendor/openai-php/client/src/Transporters/HttpTransporter.php:61

Next OpenAI\Exceptions\UnserializableResponse: Syntax error in /var/www/html/chatgpt/vendor/openai-php/client/src/Transporters/HttpTransporter.php:63
Stack trace:
#0 /var/www/html/chatgpt/vendor/openai-php/client/src/Resources/Chat.php(33): OpenAI\Transporters\HttpTransporter->requestObject()
#1 /var/www/html/chatgpt/app/Jobs/RequestItemGpt.php(159): OpenAI\Resources\Chat->create()

@gehrisandro
Copy link
Collaborator

@pavelthq Good idea. Could you make a PR?

@Radiergummi
Copy link

How about adding the request and response instances to the exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants