# language_model: Return \`AuthenticateError\`s from \`LanguageModelProvider::authenticate\` \(\#25126\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/7a6b652ebcf9b7729b4ee69130bce0fbb529e6df)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 7a6b652ebcf9b7729b4ee69130bce0fbb529e6df

Requested commit: 7a6b652ebcf9b7729b4ee69130bce0fbb529e6df

Commit: 7a6b652ebcf9b7729b4ee69130bce0fbb529e6df

Tree: fa8c4c36859c7c17e0b07bf1765ed45e6dbccbad

Author: Marshall Bowers

Committer: GitHub

## Message

```
language_model: Return `AuthenticateError`s 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
```

## Parents

- [2627a5fdbe2a0373f0585db38bbce71e9e773673](https://git.cafe/gitcafe/zed/commit/2627a5fdbe2a0373f0585db38bbce71e9e773673?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/7a6b652ebcf9b7729b4ee69130bce0fbb529e6df?format=markdown)
