Return None on 404
This commit is contained in:
parent
6ad99561e7
commit
27b4f50f69
@ -84,6 +84,8 @@ class MinioService(StorageServiceInterface):
|
|||||||
try:
|
try:
|
||||||
url = settings.AWS_HOST + filename
|
url = settings.AWS_HOST + filename
|
||||||
response = requests.get(url, stream=True)
|
response = requests.get(url, stream=True)
|
||||||
|
if response.status_code == 404:
|
||||||
|
return file_bytes
|
||||||
file_bytes = response.content
|
file_bytes = response.content
|
||||||
except:
|
except:
|
||||||
print("Error downloading file from minio")
|
print("Error downloading file from minio")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user