Skip to content

chore(dxlink-core): Include more details to server error#36

Open
antonio-pedro99 wants to merge 2 commits into
dxFeed:mainfrom
antonio-pedro99:fix/issue-31
Open

chore(dxlink-core): Include more details to server error#36
antonio-pedro99 wants to merge 2 commits into
dxFeed:mainfrom
antonio-pedro99:fix/issue-31

Conversation

@antonio-pedro99
Copy link
Copy Markdown
Member

This pull request improves how errors are handled and exposed in the DXLink WebSocket client and core libraries. The main focus is on ensuring that error listeners receive a normalized error object that includes the channel where the error occurred, making error handling more consistent and informative. The changes affect both the implementation and tests, as well as the protocol specification documentation.

Error Handling Improvements

  • The DXLinkError interface now includes a channel field, indicating the channel where the error happened (0 for connection-level errors).
  • The WebSocket client now consistently maps server error frames to public error objects with type, channel, and message, ensuring all error listeners receive full error context. [1] [2] [3] [4] [5] [6]

Testing Enhancements

  • Added a new test in index.test.ts to verify that both connection and channel error listeners receive the correct error payload, including the channel metadata.

Documentation Updates

  • The protocol specification was updated to clarify that error listeners receive normalized error objects with type, channel, and message, and to explain how protocol error frames are routed and exposed.

Test and Type Imports

  • Updated test files to import the new and required types for improved type safety and test clarity. [1] [2]

Fixes #31

@antonio-pedro99 antonio-pedro99 marked this pull request as ready for review April 24, 2026 11:54
Comment thread dxlink-javascript/dxlink-websocket-client/SPECIFICATION.md Outdated
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.

WebSocketClient channels do not expose full error payload

2 participants