Skip to content

Commit

Permalink
Clean up the console message for possible S3 errors (#1094)
Browse files Browse the repository at this point in the history
* Since #1086 haven't seen any of these yet for #486
* Use an environment variable to toggle monitoring this for now


Applies to #430

Auto-merge
  • Loading branch information
Martii authored Apr 24, 2017
1 parent 71a66d4 commit ddab15a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions controllers/scriptStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,15 @@ exports.getSource = function (aReq, aCallback) {
Bucket: bucketName,
Key: installNameBase + (isLib ? '.js' : '.user.js')

}).createReadStream().on('error', function () {
// TODO: #486
if (isDbg) {
console.error('S3 key not found for', installNameBase + (isLib ? '.js' : '.user.js'));
}).createReadStream().on('error', function (aE) {
// Possible #486 modification
if (isDbg || process.env.MONITOR_S3_READ_ERR === 'true') {
console.error(
'S3 GET',
aE.code,
'for', installNameBase + (isLib ? '.js' : '.user.js'),
'in the', bucketName, 'bucket'
);
}

aCallback(null);
Expand Down

0 comments on commit ddab15a

Please sign in to comment.