From 8a826f11285cf495c39094a621d4726711189cad Mon Sep 17 00:00:00 2001 From: Qwerty5Uiop <105209995+Qwerty5Uiop@users.noreply.github.com> Date: Tue, 22 Oct 2024 13:42:28 +0400 Subject: [PATCH] fix: Handle import exceptions in MassiveBlocksFetcher (#10993) --- .../lib/indexer/block/catchup/massive_blocks_fetcher.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/indexer/lib/indexer/block/catchup/massive_blocks_fetcher.ex b/apps/indexer/lib/indexer/block/catchup/massive_blocks_fetcher.ex index fa1c91ed5a..ea3de2e8d5 100644 --- a/apps/indexer/lib/indexer/block/catchup/massive_blocks_fetcher.ex +++ b/apps/indexer/lib/indexer/block/catchup/massive_blocks_fetcher.ex @@ -58,7 +58,7 @@ defmodule Indexer.Block.Catchup.MassiveBlocksFetcher do defp process_block(block_fetcher, number) do case Fetcher.fetch_and_import_range(block_fetcher, number..number, %{timeout: :infinity}) do {:ok, _result} -> - Logger.info("MassiveBlockFetcher successfully proceed block #{inspect(number)}") + Logger.info("MassiveBlockFetcher successfully processed block #{inspect(number)}") MassiveBlock.delete_block_number(number) [] @@ -66,6 +66,10 @@ defmodule Indexer.Block.Catchup.MassiveBlocksFetcher do Logger.error("MassiveBlockFetcher failed: #{inspect(error)}") [number] end + rescue + error -> + Logger.error("MassiveBlockFetcher failed: #{inspect(error)}") + [number] end defp generate_block_fetcher do