Skip to content

Commit 57fdd87

Browse files
committed
Log Eth1 request failures more precisely
1 parent 7979fb7 commit 57fdd87

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

beacon_chain/eth1_monitor.nim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,9 @@ template awaitWithRetries[T](lazyFutExpr: Future[T],
273273

274274
inc attempts
275275
if attempts >= retries:
276-
raise newException(DataProviderFailure,
277-
reqType & " failed " & $retries & " times")
276+
var errorMsg = reqType & " failed " & $retries & " times"
277+
if f.failed: errorMsg &= ". Last error: " & f.error.msg
278+
raise newException(DataProviderFailure, errorMsg)
278279

279280
await sleepAsync(chronos.milliseconds(retryDelayMs))
280281
retryDelayMs *= 2

0 commit comments

Comments
 (0)