Correctly catch 404 errors

The docs are super unclear on how one should catch a missing file
exception, but empirically this should catch the errors we're seeing.
This commit is contained in:
Erik Johnston 2018-03-14 12:09:41 +00:00
parent 86f5f6390f
commit 4a1356c0b2

View file

@ -118,7 +118,7 @@ class _S3DownloadThread(threading.Thread):
try: try:
resp = s3.get_object(Bucket=self.bucket, Key=self.key) resp = s3.get_object(Bucket=self.bucket, Key=self.key)
except botocore.exceptions.ClientError as e: except botocore.exceptions.ClientError as e:
if e.response['Error']['Code'] == "404": if e.response['Error']['Code'] in ("404", "NoSuchKey",):
reactor.callFromThread(self.deferred.callback, None) reactor.callFromThread(self.deferred.callback, None)
return return