Change failed download response code

This commit is contained in:
Dylan 2023-06-30 21:25:41 +01:00
parent 50b1f66c59
commit e66f5e890c

View File

@ -134,7 +134,7 @@ def lambda_handler(event, context):
return {'statusCode':400,'body':'Invalid image URL'} return {'statusCode':400,'body':'Invalid image URL'}
combined = genImageFromURL(images) combined = genImageFromURL(images)
if (combined == None): if (combined == None):
return {'statusCode':400,'body':'Failed to download image(s)'} return {'statusCode':500,'body':'Failed to download image(s)'}
buffered = BytesIO() buffered = BytesIO()
combined.save(buffered,format="JPEG",quality=60) combined.save(buffered,format="JPEG",quality=60)
combined_str=base64.b64encode(buffered.getvalue()).decode('ascii') combined_str=base64.b64encode(buffered.getvalue()).decode('ascii')