Skip to content

Commit bf3fca8

Browse files
platonfloriazavelevsky
authored andcommitted
fix: print exception when failed to collect logs from blocks
1 parent 504ae10 commit bf3fca8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

fastlane_bot/events/event_gatherer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import asyncio
2+
import traceback
13
from itertools import chain
24
from typing import Dict, List
35

4-
import asyncio
56
import nest_asyncio
67

78
from web3 import AsyncWeb3
@@ -94,4 +95,6 @@ async def _get_logs_recursive(self, from_block: int, to_block: int, topics: List
9495
self._get_logs_recursive(mid_block + 1, to_block, topics)
9596
)
9697
return [log for log_list in log_lists for log in log_list]
98+
else:
99+
traceback.print_exc(e)
97100
return []

run_blockchain_terraformer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import math
2+
import traceback
23
from typing import Tuple, List, Dict
34

45
import pandas as pd
@@ -685,6 +686,8 @@ def get_events_recursive(get_logs: any, start_block: int, end_block: int) -> lis
685686
event_list_1 = get_events_recursive(get_logs, start_block, mid_block)
686687
event_list_2 = get_events_recursive(get_logs, mid_block + 1, end_block)
687688
return event_list_1 + event_list_2
689+
else:
690+
traceback.print_exc(e)
688691
return []
689692

690693

0 commit comments

Comments
 (0)