log errors in s3 object copy

This commit is contained in:
Cassie Tarakajian 2017-05-13 21:38:48 -04:00
parent 3c6049ceef
commit dc9ad0eea9
1 changed files with 3 additions and 0 deletions

View File

@ -96,6 +96,9 @@ export function copyObjectInS3(req, res) {
Key: `${userId}/${newFilename}`
};
const copy = client.copyObject(params);
copy.on('err', (err) => {
console.log(err);
});
copy.on('end', () => {
res.json({ url: `${s3Bucket}${userId}/${newFilename}` });
});