From 9eedacf4c2cfd94188da0012d1af1f67a2bafced Mon Sep 17 00:00:00 2001 From: Hans Otto Wirtz Date: Sat, 26 Feb 2022 10:17:30 +0100 Subject: [PATCH] feat: ignore gone exceptions --- lib/utils/postToConnection.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/utils/postToConnection.ts b/lib/utils/postToConnection.ts index 5ff35389..6c775107 100644 --- a/lib/utils/postToConnection.ts +++ b/lib/utils/postToConnection.ts @@ -37,4 +37,8 @@ export const postToConnection = (server: ServerClosure) => Data: JSON.stringify(message), }) .promise() + .catch(err => { + if (err?.code !== 'GoneException') throw err + console.warn('Connection already closed at API Gateway, ignoring') + }) }