Skip to content

Commit

Permalink
better messages on download also
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed May 2, 2024
1 parent b1b7cf8 commit 5dfd33f
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions sarracenia/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1997,15 +1997,20 @@ def download(self, msg, options) -> bool:
(remote_offset == 0) and ( msg['local_offset'] == 0)

if not self.o.dry_run:
if accelerated:
len_written = self.proto[self.scheme].getAccelerated(
msg, remote_file, new_inflight_path, block_length, remote_offset, exactLength)
#FIXME: no onfly_checksum calculation during download.
else:
self.proto[self.scheme].set_path(new_inflight_path)
len_written = self.proto[self.scheme].get(
msg, remote_file, new_inflight_path, remote_offset,
msg['local_offset'], block_length, exactLength)
try:
if accelerated:
len_written = self.proto[self.scheme].getAccelerated(
msg, remote_file, new_inflight_path, block_length, remote_offset, exactLength)
#FIXME: no onfly_checksum calculation during download.
else:
self.proto[self.scheme].set_path(new_inflight_path)
len_written = self.proto[self.scheme].get(
msg, remote_file, new_inflight_path, remote_offset,
msg['local_offset'], block_length, exactLength)
except Exception as ex:
logger.error( f"could not get {remote_file}: {ex}" )
return False

else:
len_written = block_length

Expand Down Expand Up @@ -2084,9 +2089,8 @@ def download(self, msg, options) -> bool:
self.proto[self.scheme].delete(remote_file)
logger.debug('file deleted on remote site %s' %
remote_file)
except:
logger.error('unable to delete remote file %s' %
remote_file)
except Exception as ex:
logger.error( f'unable to delete remote file {remote_file}: {ex}' )
logger.debug('Exception details: ', exc_info=True)

if (self.o.acceptSizeWrong or (block_length == 0)) and (len_written > 0):
Expand Down

0 comments on commit 5dfd33f

Please sign in to comment.