Skip to content

Commit

Permalink
Merge pull request #68 from moreal/send-slack-noti-with-json-string
Browse files Browse the repository at this point in the history
Send bridge error slack noti with JSON-string memo
  • Loading branch information
moreal authored Dec 1, 2023
2 parents 9243422 + 48331ba commit 357d674
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/sync/upstream/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 357d674

Please sign in to comment.