-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
Describe the bug
Unable to catch exception when LLM API runs out of credit
==> storage/logs/laravel.log <==
[2025-08-13 08:51:12] production.ERROR: Client error: `POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent` resulted in a `429 Too Many Requests` response:
{
"error": {
"code": 429,
"message": "You exceeded your current quota, please check your plan and billing deta (truncated...)
{"exception":"[object] (GuzzleHttp\\Exception\\ClientException(code: 429): Client error: `POST https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent` resulted in a `429 Too Many Requests` response:
{
\"error\": {
\"code\": 429,
\"message\": \"You exceeded your current quota, please check your plan and billing deta (truncated...)
at /var/www/stage/vxcharts10/current/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111)
[stacktrace]
To Reproduce
Steps to reproduce the behavior:
try {
$agent = Agent::make()
->key(config('gpt.gemini.key'));
$response = $agent->chat(new UserMessage($question));
$text = (string) $response->getContent();
} catch (NeuronAI\Exceptions\NeuronException $e) {
// catch all the exception generated just from the agent
} catch (NeuronAI\Exceptions\ProviderException $e) {
// Fired from AI providers and embedding providers
// expected out of credit exception here
}
Expected behavior
Expected the exception to be caught at expected out of credit exception here
Screenshots
N/A
The Neuron AI version you are using:
- 1.16.14
Additional context
N/A
Metadata
Metadata
Assignees
Labels
No labels