From 3c8498aed5f36fc547ae9dc71f77d7dcf4d29c8e Mon Sep 17 00:00:00 2001 From: aricart Date: Thu, 30 Nov 2023 18:36:18 -0400 Subject: [PATCH] [DEBUG] close trace --- nats-base-client/protocol.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nats-base-client/protocol.ts b/nats-base-client/protocol.ts index 2eeffc5a..a713593b 100644 --- a/nats-base-client/protocol.ts +++ b/nats-base-client/protocol.ts @@ -394,6 +394,7 @@ export class ProtocolHandler implements Dispatcher { pendingLimit: number; lastError?: NatsError; abortReconnect: boolean; + whyClosed: string; servers: Servers; server!: ServerImpl; @@ -419,6 +420,7 @@ export class ProtocolHandler implements Dispatcher { this.muxSubscriptions = new MuxSubscription(); this.outbound = new DataBuffer(); this.pongs = []; + this.whyClosed = ""; //@ts-ignore: options.pendingLimit is hidden this.pendingLimit = options.pendingLimit || this.pendingLimit; this.features = new Features({ major: 0, minor: 0, micro: 0 }); @@ -1029,6 +1031,7 @@ export class ProtocolHandler implements Dispatcher { if (this._closed) { return; } + this.whyClosed = new Error("close trace").stack || ""; this.heartbeats.cancel(); if (this.connectError) { this.connectError(err);