Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// console.timeEnd("pathSave");
// processed.resolve({ url: urls.url, thumb: urls.thumb, exif: _exif });
// }).fail(function(err) {
// processed.reject(err);
// });
//
// });
} else {
// exif error (doesn't mean that it found anything)
// rollbar.handleError(result.error, req);
console.log(result.error);
console.log(result.error.toString());
rollbar.reportMessage(result.error.toString(), "debug");
console.time("s3PathUpload");
// upload to s3
s3Upload(file.path, fileType, false).then(function(urls) {
console.timeEnd("s3PathUpload");
processed.resolve({ url: urls.url, thumb: urls.thumb, exif: _exif });
}).fail(function(err) {
processed.reject(err);
});
}
});
var onNewTenantAcct = function(req, userObject) {
rollbar.reportMessage("New User Signup!", "info", req);
if(userObject.advocateRole === 'linked') {
emailHandler.sendNewSignUpEmail(userObject.advocate, userObject.fullName)
.then(function (response) {
// console.log('email success', response);
})
.catch(function (error) {
rollbar.handleErrorWithPayloadData("Email notification error", { error: error }, req);
// console.log('email fail', error);
});
}
};
options.redisHostname = redisHostSplit[0];
options.redisPort = redisHostSplit[1];
options.redisOpts = {
auth_pass: options.redisPassword
};
this.redis = require('redis').createClient(
options.redisPort,
options.redisHostname,
options.redisOpts
);
this.redis.on('error', throwError.bind(null, 'Redis Connection Error'));
};
rollbar.init('34dfc593cf14456985c66ffc12c6acc4');
rollbar.reportMessage('heyyyy', 'warn');
logInstance.error = (err) => {
existingErrorLogger(err.stack ? err.stack : err)
try {
if (enableRollbar) {
if (typeof err === 'object') {
rollbar.handleError(err)
} else if (typeof err === 'string') {
rollbar.reportMessage(err)
} else {
rollbar.reportMessage('Got backend error with no error message')
}
}
} catch (ex) {
rollbar.reportMessage('Error converting message to rollbar.')
}
}
}
return tenant.save();
})
.then(function () {
rollbar.reportMessage("New Appointment Scheduled!", "info", req);
res.send({
message: 'Successfully Updated Appt Id'
});
})
.catch(function (err) {
rollbar.handleErrorWithPayloadData("Scheduling Error", { phone: req.body.appt.phone, error: err }, req);
res.status(500).send({ message: errorHandler.getErrorMessage(err) });
});
} else {
rollbar.reportMessage("Scheduling webhook didn't find an ID - probably rescheduled?", "info", req);
res.send({
message: 'No tenant ID provided'
});
}
};
.then(function (user) {
rollbar.reportMessage("New Advocate Signup!", "info", req);
res.json(user);
})
.fail(function (err) {
.then(function (userObject) {
rollbar.reportMessage("User Sign In", "info", req);
res.json(userObject);
res.end();
})
.catch(function (err) {
logInstance.error = err => {
if (enableRollbar) {
if (typeof err === "object") {
rollbar.handleError(err);
} else if (typeof err === "string") {
rollbar.reportMessage(err);
} else {
rollbar.reportMessage("Got backend error with no error message");
}
}
existingErrorLogger(err && err.stack ? err.stack : err);
};
}
logInstance.error = err => {
if (enableRollbar) {
if (typeof err === "object") {
rollbar.handleError(err);
} else if (typeof err === "string") {
rollbar.reportMessage(err);
} else {
rollbar.reportMessage("Got backend error with no error message");
}
}
existingErrorLogger(err && err.stack ? err.stack : err);
};
}
logInstance.error = (err) => {
existingErrorLogger(err.stack ? err.stack : err)
try {
if (enableRollbar) {
if (typeof err === 'object') {
rollbar.handleError(err)
} else if (typeof err === 'string') {
rollbar.reportMessage(err)
} else {
rollbar.reportMessage('Got backend error with no error message')
}
}
} catch (ex) {
rollbar.reportMessage('Error converting message to rollbar.')
}
}
}