diff --git a/src/libexec/RelayerSpokePoolIndexer.ts b/src/libexec/RelayerSpokePoolIndexer.ts index 10f25db00..14cb34871 100644 --- a/src/libexec/RelayerSpokePoolIndexer.ts +++ b/src/libexec/RelayerSpokePoolIndexer.ts @@ -286,6 +286,20 @@ async function run(argv: string[]): Promise { try { providers = getWSProviders(chainId, quorum); assert(providers.length > 0, `Insufficient providers for ${chain} (required ${quorum} by quorum)`); + providers.forEach((provider) => { + provider.on("error", (err) => + logger.debug({ at: "RelayerSpokePoolIndexer::run", message: `Caught ${chain} provider error.`, err }) + ); + + provider.on("close", () => { + logger.debug({ + at: "RelayerSpokePoolIndexer::run", + message: `${chain} provider connection closed.`, + provider: getOriginFromURL(provider.connection.url), + }); + }); + }); + logger.debug({ at: "RelayerSpokePoolIndexer::run", message: `Starting ${chain} listener.`, events, opts }); await listen(eventMgr, spokePool, events, providers, opts); } catch (err) {