patched incorrect use of "this"

This commit is contained in:
bill bittner 2017-11-14 17:29:34 -05:00
parent bc01d584d4
commit 044b98a209

View file

@ -36,18 +36,18 @@ module.exports = {
handleRequestError: function (action, originalUrl, ip, error, res) { handleRequestError: function (action, originalUrl, ip, error, res) {
logger.error(`Request Error on ${originalUrl}`, module.exports.useObjectPropertiesIfNoKeys(error)); logger.error(`Request Error on ${originalUrl}`, module.exports.useObjectPropertiesIfNoKeys(error));
postToStats(action, originalUrl, ip, null, null, error); postToStats(action, originalUrl, ip, null, null, error);
const [status, message] = this.returnErrorMessageAndStatus(error); const [status, message] = module.exports.returnErrorMessageAndStatus(error);
res res
.status(status) .status(status)
.render('requestError', this.createErrorResponsePayload(status, message)); .render('requestError', module.exports.createErrorResponsePayload(status, message));
}, },
handleApiError: function (action, originalUrl, ip, error, res) { handleApiError: function (action, originalUrl, ip, error, res) {
logger.error(`Api ${action} Error on ${originalUrl}`, module.exports.useObjectPropertiesIfNoKeys(error)); logger.error(`Api ${action} Error on ${originalUrl}`, module.exports.useObjectPropertiesIfNoKeys(error));
postToStats(action, originalUrl, ip, null, null, error); postToStats(action, originalUrl, ip, null, null, error);
const [status, message] = this.returnErrorMessageAndStatus(error); const [status, message] = module.exports.returnErrorMessageAndStatus(error);
res res
.status(status) .status(status)
.json(this.createErrorResponsePayload(status, message)); .json(module.exports.createErrorResponsePayload(status, message));
}, },
useObjectPropertiesIfNoKeys: function (err) { useObjectPropertiesIfNoKeys: function (err) {
if (Object.keys(err).length === 0) { if (Object.keys(err).length === 0) {