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

Commit b7924c95 by Matt Broadstone

forward all error messages to user

Instead of trying to parse the error messages in the connection
manager, forward all errors to the user to deal with on an as-needed
basis
1 parent 177c1653
Showing with 0 additions and 23 deletions
...@@ -44,30 +44,7 @@ ConnectionManager.prototype.connect = function(config) { ...@@ -44,30 +44,7 @@ ConnectionManager.prototype.connect = function(config) {
connection.on('connect', function(err) { connection.on('connect', function(err) {
if (err) { if (err) {
switch (err.code) {
case 'ELOGIN':
reject('Login failed.');
break;
case 'ETIMEOUT':
reject('Connection timeout.');
break;
case 'EALREADYCONNECTED':
reject('Database is already connected!');
break;
case 'EALREADYCONNECTING':
reject('Already connecting to database!');
break;
case 'EINSTLOOKUP':
reject('Instance lookup failed.');
break;
case 'ESOCKET':
reject('Socket error.');
break;
default:
reject(err); reject(err);
break;
}
return; return;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!