diff --git a/lib/PoolCluster.js b/lib/PoolCluster.js index 51158e793..1d8fdd609 100644 --- a/lib/PoolCluster.js +++ b/lib/PoolCluster.js @@ -182,7 +182,9 @@ PoolNamespace.prototype.getConnection = function(cb) { var namespace = this; if (clusterNode === null) { - return cb(new Error('Pool does not exist.')); + var err = new Error('Pool does not exist.') + err.code = 'POOL_NONEXISTENT'; + return cb(err); } cluster._getConnection(clusterNode, function(err, connection) {