Slack messaging #169

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

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.message}`, error);
logger.error('Request Error:', 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,7 +19,7 @@ module.exports = {
}
},
handlePublishError (error) {
logger.error(`Publish Error >> ${error.message}`, error);
logger.error('Publish Error:', error);
if (error.code === 'ECONNREFUSED') {
return 'Connection refused. The daemon may not be running.';
} else if (error.response.data.error) {

View file

@ -110,11 +110,12 @@ module.exports = {
if (data.result) {
resolve(data.result.download_directory);
} else {
reject(new Error('Successfully connected to lbry daemon, but unable to retrieve the download directory.'));
// reject(new Error('Successfully connected to lbry daemon, but unable to retrieve the download directory.'));
return new Error('Successfully connected to lbry daemon, but unable to retrieve the download directory.');
}
})
.catch((error) => {
logger.error('Unable to retrieve daemon download directory', error);
.catch(error => {
logger.error('Lbrynet Error:', error);
resolve('/home/lbry/Downloads/');
});
});