Skip to content

add: ws on error for unexpected http errors like 429#298

Merged
Mathieu2301 merged 1 commit intoMathieu2301:mainfrom
OguzBey:main
Jun 9, 2025
Merged

add: ws on error for unexpected http errors like 429#298
Mathieu2301 merged 1 commit intoMathieu2301:mainfrom
OguzBey:main

Conversation

@OguzBey
Copy link
Contributor

@OguzBey OguzBey commented Jun 9, 2025

very critical fix

@OguzBey
Copy link
Contributor Author

OguzBey commented Jun 9, 2025

issue #171

@Mathieu2301 Mathieu2301 requested a review from Copilot June 9, 2025 16:16
@Mathieu2301 Mathieu2301 self-assigned this Jun 9, 2025
@Mathieu2301 Mathieu2301 linked an issue Jun 9, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds an error handler on the WebSocket client to surface unexpected HTTP errors (e.g., 429) via the existing #handleError method.

  • Registers a new 'error' listener on this.#ws
  • Invokes #handleError with a custom message and the error’s message property
Comments suppressed due to low confidence (1)

src/client.js:269

  • There’s no test covering the WebSocket 'error' event handling. Consider adding a unit or integration test to verify that #handleError is invoked correctly when the WS emits an error.
this.#ws.on('error', (err) => {

@Mathieu2301 Mathieu2301 merged commit 8d2d09f into Mathieu2301:main Jun 9, 2025
5 checks passed
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.

Unexpected server response: 429

3 participants