Created
February 9, 2015 04:41
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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