Skip to content

fix: handle socket subscription errors - #5182

Open
ayaanoncrypto wants to merge 1 commit into
ethers-io:mainfrom
ayaanoncrypto:fix/socket-subscribe-error
Open

fix: handle socket subscription errors#5182
ayaanoncrypto wants to merge 1 commit into
ethers-io:mainfrom
ayaanoncrypto:fix/socket-subscribe-error

Conversation

@ayaanoncrypto

Copy link
Copy Markdown

Summary

Fixes #5178.

Attach a rejection handler to SocketSubscriber.start() after the eth_subscribe request is created. Failed subscription requests now clear the subscriber state and emit the error through the provider error event, preventing an unhandled rejection while preserving the existing API.

Validation

  • git diff --check passed.
    • The repository dependency tree did not include the local TypeScript binary, so the build was unavailable in the sandbox.

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.

WebSocketProvider: a rejected eth_subscribe is an uncatchable unhandled rejection (SocketSubscriber.start has no .catch)

1 participant