Adjust logging so NATS connection closure only logs error if the error is defined.

This commit is contained in:
2026-02-18 22:43:40 +00:00
parent 33bd1cd320
commit 0c934a748f

View File

@@ -41,7 +41,11 @@ class NatsManager {
// Handle connection close events // Handle connection close events
this.nc.closed().then((err) => { this.nc.closed().then((err) => {
log("ERROR", `NATS: Connection closed: ${err}`); if (err) {
log("ERROR", `NATS: Connection closed: ${err}`);
} else {
log("INFO", "NATS: Connection ended")
}
this.nc = null; this.nc = null;
this.js = null; this.js = null;
this.kv = null; this.kv = null;