From c6458e7272db677fa37a67882ea6a208bb0e29b1 Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Mon, 27 Aug 2018 11:50:56 -0500 Subject: [PATCH] Include transaction_hashes when update_transactions excepts --- apps/explorer/lib/explorer/chain/import.ex | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/explorer/lib/explorer/chain/import.ex b/apps/explorer/lib/explorer/chain/import.ex index b493c01f59..db171a2ff9 100644 --- a/apps/explorer/lib/explorer/chain/import.ex +++ b/apps/explorer/lib/explorer/chain/import.ex @@ -834,9 +834,14 @@ defmodule Explorer.Chain.Import do transaction_count = Enum.count(ordered_transaction_hashes) - {^transaction_count, result} = Repo.update_all(query, [], timeout: timeout) + try do + {^transaction_count, result} = Repo.update_all(query, [], timeout: timeout) - {:ok, result} + {:ok, result} + rescue + postgrex_error in Postgrex.Error -> + {:error, %{exception: postgrex_error, transaction_hashes: ordered_transaction_hashes}} + end end defp timestamp_changes_list(changes_list, timestamps) when is_list(changes_list) do