From 2b05717da36452f3eaf9f33b26df133a4fbaba6b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 13 May 2020 14:07:58 -0700 Subject: small improvements to deliver_file2disk.py --- bin/deliver_file2disk.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/deliver_file2disk.py b/bin/deliver_file2disk.py index dd9ab30..6eaf925 100755 --- a/bin/deliver_file2disk.py +++ b/bin/deliver_file2disk.py @@ -151,6 +151,8 @@ class DeliverFatcatDisk: return ('too-many-redirects', None) except requests.exceptions.ChunkedEncodingError: return ('chunked-encoding', None) + except requests.exceptions.ConnectionError: + return ('connection-error', None) if resp.status_code != 200: return ('fetch:{}'.format(resp.status_code), None) else: @@ -172,6 +174,8 @@ class DeliverFatcatDisk: continue status, content = self.fetch_content(url) if status == 'success': + if not content: + return ('null-blob', sha1hex, None) # TODO: verify sha1hex file_meta = gen_file_metadata(content) if file_meta['sha1hex'] != sha1hex: -- cgit v1.2.3