Skip to content

feat(llm, cli): Improve error message for unknown models#211

Merged
JeanMertz merged 2 commits intomainfrom
gemini-unknown-model
Jul 21, 2025
Merged

feat(llm, cli): Improve error message for unknown models#211
JeanMertz merged 2 commits intomainfrom
gemini-unknown-model

Conversation

@JeanMertz
Copy link
Collaborator

When a user specified a model that did not exist for a provider, the application would return a generic and unhelpful API error. This made it difficult for the user to understand what went wrong and how to fix it.

This change introduces specific error handling for this scenario. The Gemini provider logic now inspects 404 errors to detect when an unknown model is the cause.

The CLI now catches this new UnknownModel error and enhances it by fetching the list of available models from the provider, presenting a much more user-friendly and actionable error message to the user.

When a user specified a model that did not exist for a provider, the
application would return a generic and unhelpful API error. This made
it difficult for the user to understand what went wrong and how to fix
it.

This change introduces specific error handling for this scenario. The
Gemini provider logic now inspects 404 errors to detect when an unknown
model is the cause.

The CLI now catches this new `UnknownModel` error and enhances it by
fetching the list of available models from the provider, presenting a
much more user-friendly and actionable error message to the user.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit f1c802c into main Jul 21, 2025
13 checks passed
@JeanMertz JeanMertz deleted the gemini-unknown-model branch July 21, 2025 10:06
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

Successfully merging this pull request may close these issues.

1 participant