call the callback when no response is returned from s3 when checking if file exists

This commit is contained in:
Henry Oswald 2014-02-19 14:58:36 +00:00
parent 960b46dda0
commit 90ad2c24c6

View file

@ -101,6 +101,8 @@ module.exports =
logger.err err:err, res:res, bucketName:bucketName, key:key, "something went wrong copying file in aws"
if !res?
logger.err err:err, res:res, bucketName:bucketName, key:key, "no response object returned when checking if file exists"
err = new Error("no response from s3 #{bucketName} #{key}")
return callback(err)
exists = res.statusCode == 200
logger.log bucketName:bucketName, key:key, exists:exists, "checked if file exsists in s3"
callback(err, exists)