Skip to content

Conversation

@inkeep
Copy link
Contributor

@inkeep inkeep bot commented Feb 10, 2026

Summary

Updates the Spans and Traces documentation to reflect the new error unwrapping functionality introduced in PR #1907.

Changes

  • Updated import example to include the new unwrapError export
  • Added "Error Unwrapping" section explaining how setSpanWithError automatically unwraps nested .cause chains to surface root cause errors
  • Added "Using unwrapError Directly" section with code example for using the utility outside of span handling
  • Updated Summary section to mention automatic error unwrapping behavior

Context

PR #1907 introduces a new unwrapError utility function that traverses error .cause chains to find root cause errors. This is particularly useful because Node.js fetch() wraps underlying errors (like undici's HeadersTimeoutError) in generic TypeError: fetch failed messages. The setSpanWithError function now automatically uses this utility to record root cause errors in spans.


Related to #1907

cc @shagun-singh-inkeep for review

- Add unwrapError to import example
- Document automatic error cause chain unwrapping in setSpanWithError
- Add section on using unwrapError utility directly
- Update summary to mention automatic error unwrapping behavior
@inkeep inkeep bot requested a review from shagun-singh-inkeep February 10, 2026 21:39
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

⚠️ No Changeset found

Latest commit: 4fe3500

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agents-api Ready Ready Preview, Comment Feb 10, 2026 9:42pm
agents-docs Ready Ready Preview, Comment Feb 10, 2026 9:42pm
agents-manage-ui Ready Ready Preview, Comment Feb 10, 2026 9:42pm

Request Review

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.

1 participant