Commit bdaa8f7f authored by Cory Bryant's avatar Cory Bryant

Update logging

parent b28130d9
......@@ -50,16 +50,17 @@ module.exports=function s3BackedRenditions(config, $){
}).on("error", function(err){
var msg;
if(err && err.message){
if(err.statusCode===404){
log.info("S3 cache miss. Generating new img-opt rendition.", params.renditionPath)
}else if(err.statusCode===403){
msg = `Error downloading rendition from S3 bucket ${s3conf.bucket}. Please check config at: ${confPath}`;
emailErrorOccasionally(params.emailError, msg);
log.error(msg, err);
}else{
msg = `Error downloading rendition from S3 bucket. ${err.message}`;
log.error(msg, err);
}
if(err.statusCode===403 || 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.statsCode===404 || err.code.match(/NoSuch/) || err.code.match(/Not Found/)){
msg = `S3 cache miss, Generating new img-opt rendition. Bucket: ${s3conf.bucket} Path: ${params.renditionPath}`;
log.info(msg);
} else {
msg = `Error downloading rendition from S3 bucket. ${err.message}`;
log.error(msg, err);
}
}else{
msg=`Unknown S3 download error.`;
log.error(msg, err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment