Skip to content

Include socket details in RpcClient errors#6445

Draft
coyaSONG wants to merge 1 commit into
Effect-TS:v3from
coyaSONG:agent/fix-rpcclient-socket-error-details
Draft

Include socket details in RpcClient errors#6445
coyaSONG wants to merge 1 commit into
Effect-TS:v3from
coyaSONG:agent/fix-rpcclient-socket-error-details

Conversation

@coyaSONG

Copy link
Copy Markdown
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

RpcClient.makeProtocolSocket currently replaces every socket failure with the hardcoded message Error in socket, even though it has already extracted the typed SocketError from the cause.

Use the socket error's existing human-readable message when a typed failure is available, while retaining the generic fallback for causes without a socket failure. This surfaces details such as close codes and close reasons without changing the structured RpcClientError shape or its cause.

Add a regression test that drives the socket protocol with a SocketCloseError and verifies both the detailed message and preserved cause.

Validation:

  • pnpm lint-fix
  • pnpm test packages/rpc/test/RpcClient.test.ts --run
  • pnpm check
  • pnpm build
  • pnpm docgen

Related

@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jul 17, 2026
@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b9b482a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/rpc Patch

Not sure what this means? Click here to learn what changesets are.

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

@IMax153 IMax153 added the 3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3. label Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3.

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

2 participants