Skip to content
Browse files

Merge pull request #80 from andrzejpolis/master

Fixed ignored connection errors for mysql alpha 2.0 driver
  • Loading branch information...
2 parents ce018cb + 9dbb59a commit c6bdce1b4f187eaa0f1c0fc60dbf99a23b23404a @joeferner committed Jul 18, 2013
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/drivers/mysql.js
View
10 lib/drivers/mysql.js
@@ -96,16 +96,20 @@ var MySqlDriver = Driver.extend({
var db;
if (typeof(mysql.createConnection) === 'undefined') {
db = new mysql.createClient(opts);
+ conn = new MySqlConnection(this, db, true, opts);
+ callback(null, conn);
} else {
db = new mysql.createConnection(opts);
+ var _this = this;
db.connect(function(err) {
if (err) {
- console.log(err);
+ callback(err);
+ } else {
+ conn = new MySqlConnection(_this, db, true, opts);
+ callback(null, conn);
}
});
}
- conn = new MySqlConnection(this, db, true, opts);
- callback(null, conn);
}
},

0 comments on commit c6bdce1

Please sign in to comment.
Something went wrong with that request. Please try again.