From 57fdd87a2400da05d9464703a036bbbd596dcfac Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Thu, 10 Dec 2020 01:45:49 +0200 Subject: [PATCH] Log Eth1 request failures more precisely --- beacon_chain/eth1_monitor.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beacon_chain/eth1_monitor.nim b/beacon_chain/eth1_monitor.nim index 593632fd3..a575c3f5d 100644 --- a/beacon_chain/eth1_monitor.nim +++ b/beacon_chain/eth1_monitor.nim @@ -273,8 +273,9 @@ template awaitWithRetries[T](lazyFutExpr: Future[T], inc attempts if attempts >= retries: - raise newException(DataProviderFailure, - reqType & " failed " & $retries & " times") + var errorMsg = reqType & " failed " & $retries & " times" + if f.failed: errorMsg &= ". Last error: " & f.error.msg + raise newException(DataProviderFailure, errorMsg) await sleepAsync(chronos.milliseconds(retryDelayMs)) retryDelayMs *= 2