# Don't spawn Anthropic telemetry event when API key is missing \(\#32813\) · gitcafe/zed

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

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

Visibility: public

Requested revision: cfbc2d097279d0e70433302af23d8d056b91b5f7

Requested commit: cfbc2d097279d0e70433302af23d8d056b91b5f7

Commit: cfbc2d097279d0e70433302af23d8d056b91b5f7

Tree: 34d31810a1c44c24457f5f8ff0e59278cce23b44

Author: Richard Feldman

Committer: GitHub

## Message

```
Don't spawn Anthropic telemetry event when API key is missing (#32813)

Minor refactor that I'm extracting from a branch because it can stand
alone.

- Now we no longer spawn an executor for `report_anthropic_event` if
it's just going to immediately fail due to API key being missing
- `report_anthropic_event` now takes a `String` API key instead of
`Option<String>` and the error reporting if the key is missing has been
moved to the caller.
- `report_anthropic_event` is longer coupled to `AnthropicError`,
because all it ever did was generate an `AnthropicEvent::Other`, which
in turn was then only used for `log_err` - so, can just be an
`anyhow::Result`.

Release Notes:

- N/A
```

## Parents

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

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