不要怂,就是干,撸起袖子干!

Commit 317032ef by Matt Broadstone

prevent tedious errors from taking down app

Tedious error events must be handled in the connection manager in
order to prevent said errors from crashing an app using sequelize
to connect to a mssql database.
1 parent ec3b327c
Showing with 5 additions and 0 deletions
......@@ -47,6 +47,11 @@ ConnectionManager.prototype.connect = function(config) {
var connection = new self.lib.Connection(connectionConfig);
connection.lib = self.lib;
// don't let tedious errors take down the entire application
connection.on('error', function(err) {
connection._invalid = true;
});
connection.on('connect', function(err) {
if (!err) {
resolve(connection);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!