Skip to content

Commit

Permalink
[FIX] protocol's disconnect handler didn't forward the initial discon…
Browse files Browse the repository at this point in the history
…nect error when it closed the client.
  • Loading branch information
aricart committed Nov 1, 2022
1 parent 3835f1d commit f82e800
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nats-base-client/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export class ProtocolHandler implements Dispatcher<ParserEvent> {
this.transport.disconnect();
}

async disconnected(_err?: Error): Promise<void> {
async disconnected(err?: Error): Promise<void> {
this.dispatchStatus(
{
type: Events.Disconnect,
Expand All @@ -265,7 +265,7 @@ export class ProtocolHandler implements Dispatcher<ParserEvent> {
this._close(err);
});
} else {
await this._close();
await this._close(err);
}
}

Expand Down

0 comments on commit f82e800

Please sign in to comment.