Skip to content

Instantly share code, notes, and snippets.

@lvegerano
Created February 9, 2015 04:41
Show Gist options
  • Save lvegerano/7cec1f319e3730d50484 to your computer and use it in GitHub Desktop.
Save lvegerano/7cec1f319e3730d50484 to your computer and use it in GitHub Desktop.
Sample with async and sequelize where the "catch all" .catch() still get an unhandled exception.
async.series([
function(callback) {
sequelize
.authenticate()
.then(function() {
callback();
})
.catch(function authException(err) {
//console.log(err);
callback(err);
});
},
function(callback) {
sequelize
.sync(syncOptions)
.then(function() {
callback();
})
.catch(function syncException(err) {
callback(err);
});
}],
function(err) {
if (err) {
//handle error
}
//do stuff herer :D
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment