`[12-May-2023 20:10:23 UTC] PHP Fatal error: Uncaught OpenAI\Exceptions\ErrorException: That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID XXXXXXXXX in your message.) in /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php:66
Stack trace:
I am getting this error sometimes:
`[12-May-2023 20:10:23 UTC] PHP Fatal error: Uncaught OpenAI\Exceptions\ErrorException: That model is currently overloaded with other requests. You can retry your request, or contact us through our help center at help.openai.com if the error persists. (Please include the request ID XXXXXXXXX in your message.) in /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php:66 Stack trace:
0 /var/www/html/vendor/openai-php/client/src/Resources/Chat.php(32): OpenAI\Transporters\HttpTransporter->requestObject()
1 /var/www/html/get.php(232): OpenAI\Resources\Chat->create()
2 /var/www/html/get.php(492): poll()
3 {main}
thrown in /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php on line 66`
Here is my code:
try { $response = $client->chat()->create([ 'model' => 'gpt-3.5-turbo', 'messages' => [ ['role' => 'system', 'content' => 'XXXXXXX'], ['role' => 'user', 'content' => 'YYYYYY'], ], ]); } catch (ErrorException $e) { write_log("OpenAI error [Exception]: ".$e->getMessage()); $api_error = true; }
Why do I still get a Fatal PHP error that breaks the code? The exception seems to get missed.