Handle callback errors

This commit is contained in:
Mathias Schreck
2016-08-16 19:46:59 +02:00
parent d43c19c173
commit ce9ee62fa0
64 changed files with 359 additions and 23 deletions

View File

@@ -202,6 +202,10 @@ Controllers.registerInterstitial = function(req, res, next) {
userData: req.session.registration,
interstitials: []
}, function(err, data) {
if (err) {
return next(err);
}
if (!data.interstitials.length) {
return next();
}
@@ -212,6 +216,10 @@ Controllers.registerInterstitial = function(req, res, next) {
var errors = req.flash('error');
async.parallel(renders, function(err, sections) {
if (err) {
return next(err);
}
res.render('registerComplete', {
errors: errors,
sections: sections