Skip to content

Commit

Permalink
fix(parcel collection): Send error codes to server when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Oct 19, 2020
1 parent 9ffe781 commit 4987131
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
6 changes: 1 addition & 5 deletions src/lib/PoWebClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,7 @@ export class PoWebClient {
} finally {
stateManager.throwConnectionErrorIfAny();

if (stateManager.hasServerClosedConnection) {
ws.close(WebSocketCode.NORMAL);
} else {
ws.close(stateManager.clientCloseFrame.code, stateManager.clientCloseFrame.reason);
}
ws.close(stateManager.clientCloseFrame.code, stateManager.clientCloseFrame.reason);

stateManager.throwClientErrorIfAny();
}
Expand Down
4 changes: 0 additions & 4 deletions src/lib/_websocketUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ export class WebSocketStateManager {
// tslint:disable-next-line:readonly-keyword
private connectionError: Error | undefined;

get hasServerClosedConnection(): boolean {
return !!this.serverCloseFrame;
}

get clientCloseFrame(): CloseFrame {
return this._clientCloseFrame;
}
Expand Down

0 comments on commit 4987131

Please sign in to comment.