From 48331ba7a5b9f927f743485ca8c765525b3f4377 Mon Sep 17 00:00:00 2001 From: moreal Date: Fri, 1 Dec 2023 19:23:54 +0900 Subject: [PATCH] Send bridge error slack noti with JSON-string memo --- src/sync/upstream/index.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/sync/upstream/index.ts b/src/sync/upstream/index.ts index 5016d0c..63791ff 100644 --- a/src/sync/upstream/index.ts +++ b/src/sync/upstream/index.ts @@ -215,12 +215,16 @@ export async function processUpstreamEvents( } for (const ev of unloadGarageEventsWithInvalidMemo) { - await slackBot.sendMessage( - new BridgeErrorEvent( - [upstreamNetworkId, ev.txId], - new Error(`INVALID_MEMO: ${ev.parsedMemo}`), - ), - ); + try { + await slackBot.sendMessage( + new BridgeErrorEvent( + [upstreamNetworkId, ev.txId], + new Error(`INVALID_MEMO: ${JSON.stringify(ev.parsedMemo)}`), + ), + ); + } catch (e) { + console.error("[sync][upstream] Failed to send slack message", e); + } } }