Slack messaging #169

Merged
bones7242 merged 11 commits from slack-messaging into master 2017-09-21 21:11:32 +02:00
4 changed files with 8 additions and 10 deletions
Showing only changes of commit ebff2cf62b - Show all commits

View file

@ -35,7 +35,7 @@ module.exports = {
});
})
.catch(error => {
logger.error('Sequelize error', error);
logger.error('Sequelize error >>', error);
});
},
sendGoogleAnalytics (action, headers, ip, originalUrl) {
@ -137,7 +137,7 @@ module.exports = {
resolve({ records: resultHashTable, totals: { totalServe, totalPublish, totalShow, totalCount, totalSuccess, totalFailure }, percentSuccess });
})
.catch(error => {
logger.error('sequelize error', error);
logger.error('sequelize error >>', error);
reject(error);
});
});
@ -161,7 +161,7 @@ module.exports = {
resolve(results);
})
.catch(error => {
logger.error('sequelize error', error);
logger.error('sequelize error >>', error);
reject(error);
});
});

View file

@ -3,7 +3,7 @@ const { postToStats } = require('../controllers/statsController.js');
module.exports = {
handleRequestError (action, originalUrl, ip, error, res) {
logger.error('Request Error >>', error);
logger.error(`Request Error >> ${error.message}`, error);
if (error.response) {
kauffj commented 2017-09-16 00:18:31 +02:00 (Migrated from github.com)
Review

When is there a non-enumerable property being passed that this is required?

When is there a non-enumerable property being passed that this is required?
bones7242 commented 2017-09-21 21:10:37 +02:00 (Migrated from github.com)
Review

for errors created by node (e.g. new Error('error message')) the stack and message are non-enumerable

for errors created by node (e.g. `new Error('error message')`) the stack and message are non-enumerable
postToStats(action, originalUrl, ip, null, null, error.response.data.error.messsage);
res.status(error.response.status).send(error.response.data.error.message);
@ -19,14 +19,12 @@ module.exports = {
}
},
handlePublishError (error) {
logger.error(`Publish Error >> ${error.message}`, error);
if (error.code === 'ECONNREFUSED') {
logger.error('Publish Error:', 'Connection refused. The daemon may not be running.');
return 'Connection refused. The daemon may not be running.';
} else if (error.response.data.error) {
logger.error('Publish Error:', error.response.data.error);
return error.response.data.error.message;
} else {
logger.error('Unhandled Publish Error:', error.message);
return error;
}
},

View file

@ -114,7 +114,7 @@ module.exports = {
}
})
.catch((error) => {
logger.error('Unable to retrieve daemon download directory. Restart spee.ch once the daemon is ready. Using default "/home/lbry/Downloads".', error);
logger.error('Unable to retrieve daemon download directory', error);
resolve('/home/lbry/Downloads/');
});
});

View file

@ -135,7 +135,7 @@ app.set('view engine', 'handlebars');
db.sequelize
.sync() // sync sequelize
.then(() => { // get the download directory from the daemon
logger.info('Retrieving daemon download directory');
logger.info('Retrieving daemon download directory...');
return getDownloadDirectory();
})
.then(hostedContentPath => {
@ -155,5 +155,5 @@ db.sequelize
});
})
.catch((error) => {
logger.error('Startup Error', error);
logger.error(`Startup Error >> ${error.message}`, error);
});