Skip to content

fix(anthropic): Capture exceptions for stream() calls#5950

Open
alexander-alderman-webb wants to merge 2 commits intowebb/anthropic/remove-set-span-erroredfrom
webb/anthropic/exceptions-on-stream
Open

fix(anthropic): Capture exceptions for stream() calls#5950
alexander-alderman-webb wants to merge 2 commits intowebb/anthropic/remove-set-span-erroredfrom
webb/anthropic/exceptions-on-stream

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Apr 7, 2026

Description

Wrap the library function in a try-except and capture the exception if one is raised.

Issues

Reminders

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (integrations) Instrument pyreqwest tracing by servusdei2018 in #5682

Bug Fixes 🐛

Anthropic

  • Set exceptions on spans for stream() calls by alexander-alderman-webb in #5950
  • Stop setting transaction to errored when child span fails by alexander-alderman-webb in #5717
  • Only finish relevant spans in .create() patches by alexander-alderman-webb in #5716

Internal Changes 🔧

  • (anthropic) Separate sync and async .create() patches by alexander-alderman-webb in #5715
  • (openai) Split token counting by API for easier deprecation by ericapisani in #5930
  • (opentelemetry) Ignore mypy error by alexander-alderman-webb in #5927
  • Fix license metadata in setup.py by sl0thentr0py in #5934
  • Update validate-pr workflow by stephanie-anderson in #5931

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Codecov Results 📊

10 passed | Total: 10 | Pass Rate: 100% | Execution Time: 2.54s

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 14837 uncovered lines.

Files with missing lines (1)
File Patch % Lines
anthropic.py 5.43% ⚠️ 418 Missing

Generated by Codecov Action

@alexander-alderman-webb alexander-alderman-webb changed the title fix(anthropic): Set exceptions on spans for stream() calls fix(anthropic): Capture exceptions for stream() calls Apr 7, 2026
@alexander-alderman-webb alexander-alderman-webb changed the title fix(anthropic): Capture exceptions for stream() calls fix(anthropic): Capture exceptions for stream() calls Apr 7, 2026
@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review April 7, 2026 13:38
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner April 7, 2026 13:38
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.

2 participants