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

Commit ffc35bb1 by David Pate

Added logic for when an error doesn't have an `code` property.

1 parent 9ef2cf55
Showing with 4 additions and 0 deletions
......@@ -41,6 +41,7 @@ ConnectionManager.prototype.connect = function(config) {
connection.connect(function(err) {
if (err) {
if (err.code) {
switch (err.code) {
case 'ECONNREFUSED':
reject(new sequelizeErrors.ConnectionRefusedError(err));
......@@ -61,6 +62,9 @@ ConnectionManager.prototype.connect = function(config) {
reject(new sequelizeErrors.ConnectionError(err));
break;
}
} else {
reject(new sequelizeErrors.ConnectionError(err));
}
return;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!