Skip to content

Commit

Permalink
fix(project): crash when connection lost during handshake
Browse files Browse the repository at this point in the history
  • Loading branch information
fenying committed Nov 24, 2023
1 parent 44cff0d commit 15b871c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## v1.1.2

- fix(project): crash when connection lost during handshake.

## v1.1.1

- fix(project): use native `Error` as the based class for exceptions.
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/lwdfx",
"version": "1.1.1",
"version": "1.1.2",
"description": "A TypeScript implement of light-weight data frame exchange protocol.",
"main": "lib/index.js",
"scripts": {
Expand Down
9 changes: 8 additions & 1 deletion src/lib/AbstractConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,15 @@ export abstract class AbstractConnection extends $Events.EventEmitter implements
return;
}

this._setupSocket();
try {

this._setupSocket();
}
catch (e) {

callback(e);
return;
}
callback(null, this);
});
}
Expand Down

0 comments on commit 15b871c

Please sign in to comment.