From eddc373c0e7e2a7f2949314e84f92691b4f2cc16 Mon Sep 17 00:00:00 2001 From: quibusus Date: Mon, 9 Jun 2014 15:57:42 +0200 Subject: [PATCH] added error code to pool does not exist error --- lib/PoolCluster.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) {