language_model: Return AuthenticateErrors from LanguageModelProvider::authenticate (#25126)

This PR updates the `LanguageModelProvider::authenticate` method to
return an `AuthenticateError` instead of an `anyhow::Error`.

This allows us to model the "credentials not found" state explicitly as
`AuthenticateError::CredentialsNotFound`, which enables the caller to
check for this state and act accordingly.

Planning to use this in #25123 to silence errors about missing
credentials when authenticating providers in the background.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-02-19 00:01:48 +00:00
committed by GitHub
parent 2627a5fdbe
commit 7a6b652ebc
14 changed files with 230 additions and 184 deletions
Generated
+1
View File
@@ -6951,6 +6951,7 @@ dependencies = [
"serde_json",
"smol",
"strum",
"thiserror 1.0.69",
"ui",
"util",
]