Commit e47ca673 authored by Cory Bryant's avatar Cory Bryant

update error checks

parent 0d9cc0c7
......@@ -42,11 +42,11 @@ module.exports=function s3BackedRenditions(config, $){
}, function(err, data) {
if (err) {
var msg;
if(err.match(/Forbidden/) || err.match(/AccessDenied/) || err.match(/Invalid/)){
if(err.code.match(/Forbidden/) || err.code.match(/AccessDenied/) || err.code.match(/Invalid/)){
msg = `Error downloading rendition from S3 bucket ${s3conf.bucket}. Please check config at: ${confPath}`;
emailErrorOccasionally(params.emailError, msg);
log.error(msg, err);
} else if(err.match(/NoSuch/) || err.match(/Not Found/)){
} else if(err.code.match(/NoSuch/) || err.code.match(/Not Found/)){
msg = `S3 cache miss, Generating new img-opt rendition. Bucket: ${s3conf.bucket} Path: ${params.renditionPath}`;;
} else {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment