Skip to content

Commit

Permalink
#971 catch only specific exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Dec 21, 2023
1 parent 880ef84 commit aff6b22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/schains/dkg/broadcast_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from dataclasses import dataclass
import logging

from web3.exceptions import TransactionNotFound
from web3.exceptions import Web3Exception, TransactionNotFound

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -119,7 +119,7 @@ def get_events(self, from_channel_started_block=False):
pass

Check warning on line 119 in core/schains/dkg/broadcast_filter.py

View check run for this annotation

Codecov / codecov/patch

core/schains/dkg/broadcast_filter.py#L118-L119

Added lines #L118 - L119 were not covered by tests
self.first_unseen_block = block_number + 1
return events
except Exception as e:
except (ValueError, Web3Exception) as e:
logger.info(f'sChain {self.group_index_str}: error during collecting broadcast '

Check warning on line 123 in core/schains/dkg/broadcast_filter.py

View check run for this annotation

Codecov / codecov/patch

core/schains/dkg/broadcast_filter.py#L122-L123

Added lines #L122 - L123 were not covered by tests
f'events: {e}')
return events

Check warning on line 125 in core/schains/dkg/broadcast_filter.py

View check run for this annotation

Codecov / codecov/patch

core/schains/dkg/broadcast_filter.py#L125

Added line #L125 was not covered by tests

0 comments on commit aff6b22

Please sign in to comment.