Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.catch(function (error) {
rollbar.handleErrorWithPayloadData("Email notification error", { error: error }, req);
// console.log('email fail', error);
});
}
app.use(function(err, req, res, next) {
// If the error object doesn't exists
if (!err) return next();
// Log it
console.error(err.stack);
// Rollbar time!
rollbar.handleErrorWithPayloadData(err, {}, req);
// Error page
// using the message part for the moment
// res.status(500).render('500', {
// error: err.stack
// });
res.status(500).send({
errors: [{
message: err.stack
}]
});
.catch(function (error) {
rollbar.handleErrorWithPayloadData("Email notification error", { error: error }, req);
// console.log('email fail', error);
});
}
.catch(function (err) {
rollbar.handleErrorWithPayloadData("Scheduling Error", { phone: req.body.appt.phone, error: err }, req);
res.status(500).send({ message: errorHandler.getErrorMessage(err) });
});
} else {