From ec71893ec89e3c66d211e5b5ff8184e6b456a5e1 Mon Sep 17 00:00:00 2001 From: Alexander Tsybulsky Date: Tue, 15 Mar 2022 21:15:25 +0200 Subject: [PATCH] fix #1368, log httpServer.close error only when defined (#1369) --- src/receivers/SocketModeReceiver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/receivers/SocketModeReceiver.ts b/src/receivers/SocketModeReceiver.ts index 36d33c307..3352679f5 100644 --- a/src/receivers/SocketModeReceiver.ts +++ b/src/receivers/SocketModeReceiver.ts @@ -241,7 +241,7 @@ export default class SocketModeReceiver implements Receiver { if (this.httpServer !== undefined) { // This HTTP server is only for the OAuth flow support this.httpServer.close((error) => { - this.logger.error(`Failed to shutdown the HTTP server for OAuth flow: ${error}`); + if (error) this.logger.error(`Failed to shutdown the HTTP server for OAuth flow: ${error}`); }); } return new Promise((resolve, reject) => {