Reputation: 522
I'm trying to create an Alexa Skill on the Alexa Developer Console (using Alexa Hosted) and I want to recover a file from the bucket.
I created the file successfully, but when I try to recover it is not returning anything and I don't see any kind of error in the logs.
That's my code:
async function getGameData(key)
{
const params = {
Bucket: BUCKET,
Key: key
};
const respose = await S3.getObject(params, (err => {
if(err) {
console.log('Error recovering the file')
}
}))
return respose.Body;
}
and there are my logs: logs
Thanks for the help :D
Upvotes: 1
Views: 124
Reputation: 1602
In the AWS SDK for Javascript, S3.getObject
does not return a promise. You must use .promise()
.
let response;
try {
response = await S3.getObject(params).promise();
} catch (e) {
console.log('Error recovering the file');
}
Upvotes: 2