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
This commit is contained in:
Richard Feldman 2025-06-16 14:58:37 -04:00 committed by GitHub
parent 6e04b9ef65
commit cfbc2d0972
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 28 deletions

1
Cargo.lock generated
View file

@ -8944,6 +8944,7 @@ dependencies = [
"http_client",
"icons",
"image",
"log",
"parking_lot",
"proto",
"schemars",