Skip to content

Commit

Permalink
caller logs and handles exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Allie Crevier committed Dec 9, 2019
1 parent 033301b commit 2326f4a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions securedrop_client/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,10 @@ def get_remote_data(api: API) -> Tuple[List[SDKSource], List[SDKSubmission], Lis
(remote_sources, remote_submissions, remote_replies)
"""
remote_submissions = [] # type: List[SDKSubmission]
try:
remote_sources = api.get_sources()
for source in remote_sources:
remote_submissions.extend(api.get_submissions(source))
remote_replies = api.get_all_replies()
except Exception as ex:
# Log any errors but allow the caller to handle the exception.
logger.error(ex)
raise(ex)
remote_sources = api.get_sources()
for source in remote_sources:
remote_submissions.extend(api.get_submissions(source))
remote_replies = api.get_all_replies()

logger.info('Fetched {} remote sources.'.format(len(remote_sources)))
logger.info('Fetched {} remote submissions.'.format(
Expand Down

0 comments on commit 2326f4a

Please sign in to comment.