Merge pull request #5 from matrix-org/erikj/404_correctly

Correctly catch 404 errors
This commit is contained in:
Erik Johnston 2018-03-14 13:49:40 +00:00 committed by GitHub
commit 54c58922de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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