Slack messaging #169
4 changed files with 8 additions and 10 deletions
|
@ -35,7 +35,7 @@ module.exports = {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
logger.error('Sequelize error', error);
|
logger.error('Sequelize error >>', error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
sendGoogleAnalytics (action, headers, ip, originalUrl) {
|
sendGoogleAnalytics (action, headers, ip, originalUrl) {
|
||||||
|
@ -137,7 +137,7 @@ module.exports = {
|
||||||
resolve({ records: resultHashTable, totals: { totalServe, totalPublish, totalShow, totalCount, totalSuccess, totalFailure }, percentSuccess });
|
resolve({ records: resultHashTable, totals: { totalServe, totalPublish, totalShow, totalCount, totalSuccess, totalFailure }, percentSuccess });
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
logger.error('sequelize error', error);
|
logger.error('sequelize error >>', error);
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -161,7 +161,7 @@ module.exports = {
|
||||||
resolve(results);
|
resolve(results);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
logger.error('sequelize error', error);
|
logger.error('sequelize error >>', error);
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,7 +3,7 @@ const { postToStats } = require('../controllers/statsController.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
handleRequestError (action, originalUrl, ip, error, res) {
|
handleRequestError (action, originalUrl, ip, error, res) {
|
||||||
logger.error('Request Error >>', error);
|
logger.error(`Request Error >> ${error.message}`, error);
|
||||||
if (error.response) {
|
if (error.response) {
|
||||||
for errors created by node (e.g. 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);
|
postToStats(action, originalUrl, ip, null, null, error.response.data.error.messsage);
|
||||||
res.status(error.response.status).send(error.response.data.error.message);
|
res.status(error.response.status).send(error.response.data.error.message);
|
||||||
|
@ -19,14 +19,12 @@ module.exports = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handlePublishError (error) {
|
handlePublishError (error) {
|
||||||
|
logger.error(`Publish Error >> ${error.message}`, error);
|
||||||
if (error.code === 'ECONNREFUSED') {
|
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.';
|
return 'Connection refused. The daemon may not be running.';
|
||||||
} else if (error.response.data.error) {
|
} else if (error.response.data.error) {
|
||||||
logger.error('Publish Error:', error.response.data.error);
|
|
||||||
return error.response.data.error.message;
|
return error.response.data.error.message;
|
||||||
} else {
|
} else {
|
||||||
logger.error('Unhandled Publish Error:', error.message);
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -114,7 +114,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.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/');
|
resolve('/home/lbry/Downloads/');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -135,7 +135,7 @@ app.set('view engine', 'handlebars');
|
||||||
db.sequelize
|
db.sequelize
|
||||||
.sync() // sync sequelize
|
.sync() // sync sequelize
|
||||||
.then(() => { // get the download directory from the daemon
|
.then(() => { // get the download directory from the daemon
|
||||||
logger.info('Retrieving daemon download directory');
|
logger.info('Retrieving daemon download directory...');
|
||||||
return getDownloadDirectory();
|
return getDownloadDirectory();
|
||||||
})
|
})
|
||||||
.then(hostedContentPath => {
|
.then(hostedContentPath => {
|
||||||
|
@ -155,5 +155,5 @@ db.sequelize
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
logger.error('Startup Error', error);
|
logger.error(`Startup Error >> ${error.message}`, error);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue
When is there a non-enumerable property being passed that this is required?