Skip to content

Commit

Permalink
new try except for internal errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Meyer committed Mar 12, 2018
1 parent f811e72 commit 987e312
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions trufflepig/bchain/getdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,21 @@ def get_all_posts_from_block(block_num, steem,
List of post dicts and set of authors and permalinks
"""
operations = steem.get_ops_in_block(block_num, False)
if operations:
authors_and_permalinks = extract_authors_and_permalinks(operations)
if exclude_authors_and_permalinks:
authors_and_permalinks -= exclude_authors_and_permalinks
if authors_and_permalinks:
return get_post_data(authors_and_permalinks, steem,
exclusion_voters), authors_and_permalinks
try:
operations = steem.get_ops_in_block(block_num, False)
if operations:
authors_and_permalinks = extract_authors_and_permalinks(operations)
if exclude_authors_and_permalinks:
authors_and_permalinks -= exclude_authors_and_permalinks
if authors_and_permalinks:
return get_post_data(authors_and_permalinks, steem,
exclusion_voters), authors_and_permalinks
else:
logger.debug('Could not find any posts for block {}'.format(block_num))
else:
logger.debug('Could not find any posts for block {}'.format(block_num))
else:
logger.warning('Could not find any operations for block {}'.format(block_num))
logger.warning('Could not find any operations for block {}'.format(block_num))
except Exception as e:
logger.exception('Error for block {}'.format(block_num))
return [], set()


Expand Down

0 comments on commit 987e312

Please sign in to comment.