Skip to content

Commit

Permalink
fix(client): connection close during handshaking should not throw an …
Browse files Browse the repository at this point in the history
…error
  • Loading branch information
fenying committed Mar 22, 2024
1 parent 7e4324b commit 4163ee9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## v0.2.1

- fix(client): connection close during handshaking should not throw an error.

## v0.2.0

- build(project): use term `message` instead of `frame`.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@litert/websocket",
"version": "0.2.0",
"version": "0.2.1",
"description": "The websocket protocol library for LiteRT.",
"main": "lib/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ function connect(

resolve(ws);
})
.on('close', () => {

reject(new E.E_HANDSHAKE_FAILED('Connection closed'));
})
.on('error', (e) => {

reject(e);
Expand Down

0 comments on commit 4163ee9

Please sign in to comment.