Skip to content

Commit 8d2d09f

Browse files
authored
add: ws on error for unexpected http errors like 429 (#298)
2 parents 4047545 + 2de39b9 commit 8d2d09f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/client.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ module.exports = class Client {
266266
this.#handleEvent('disconnected');
267267
});
268268

269+
this.#ws.on('error', (err) => {
270+
this.#handleError('WebSocket error:', err.message);
271+
});
272+
269273
this.#ws.on('message', (data) => this.#parsePacket(data));
270274
}
271275

0 commit comments

Comments
 (0)