Skip to content

The error message is not accurate when using pool cluster to create connection #818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
purejs opened this issue May 16, 2014 · 1 comment
Labels
Milestone

Comments

@purejs
Copy link

purejs commented May 16, 2014

Version: .2.2.0
Step to recreate:
Step 1: create cluster

var mysql = require( 'mysql' );
var poolCluster = mysql.createPoolCluster( );
var cfg =  {
    host:localhost,
    database: testdb,
    user: 'testUser',
    password: 'password' 
};

poolCluster.add( 'test', cfg );

Step 2: use cluster to connect db

poolCluster.getConnection( 'test', function( err, connection ) {
    if ( err ) {
        console.log( err ) 
    }
    // ...
} );

Result:
The error message is 'Pool does not exist', but actually, i just forget to set insecureAuth=true in cfg which causes the error of HANDSHAKE_INSECURE_AUTH.

Expectation:
The error message should reflect the reason why the pool does not exist or expose the error directly when creating connection not successfully.

Many thanks.

@dougwilson
Copy link
Member

Thank you, I can confirm this. Looks like any connection error causes this behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants