Skip to content

Commit 4163ee9

Browse files
committed
fix(client): connection close during handshaking should not throw an error
1 parent 7e4324b commit 4163ee9

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes
22

3+
## v0.2.1
4+
5+
- fix(client): connection close during handshaking should not throw an error.
6+
37
## v0.2.0
48

59
- build(project): use term `message` instead of `frame`.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@litert/websocket",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "The websocket protocol library for LiteRT.",
55
"main": "lib/index.js",
66
"scripts": {

src/lib/Client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ function connect(
222222

223223
resolve(ws);
224224
})
225+
.on('close', () => {
226+
227+
reject(new E.E_HANDSHAKE_FAILED('Connection closed'));
228+
})
225229
.on('error', (e) => {
226230

227231
reject(e);

0 commit comments

Comments
 (0)