rethinkdbdash
Advanced tools
Comparing version 2.0.14 to 2.0.15
@@ -171,5 +171,20 @@ var net = require('net'); | ||
self.emit('release'); | ||
if (typeof self.metadata[token].reject === 'function') { | ||
self.metadata[token].reject(new Err.ReqlClientError(helper.makeAtom(response), self.metadata[token].query, response)); | ||
currentResolve = self.metadata[token].resolve; | ||
currentReject = self.metadata[token].reject; | ||
self.metadata[token].removeCallbacks(); | ||
currentReject(new Err.ReqlClientError(helper.makeAtom(response), self.metadata[token].query, response)); | ||
if (typeof self.metadata[token].endReject !== 'function') { | ||
// No pending STOP query, we can delete | ||
delete self.metadata[token] | ||
} | ||
} | ||
else if (typeof self.metadata[token].endResolve === 'function') { | ||
currentResolve = self.metadata[token].endResolve; | ||
currentReject = self.metadata[token].endReject; | ||
self.metadata[token].removeEndCallbacks(); | ||
currentReject(new Err.ReqlClientError(helper.makeAtom(response), self.metadata[token].query, response)); | ||
delete self.metadata[token] | ||
} | ||
else if (token === -1) { // This should not happen now since 1.13 took the token out of the query | ||
@@ -183,5 +198,4 @@ var error = new Err.ReqlClientError(helper.makeAtom(response)+'\nClosing all outstanding queries...'); | ||
self.close(); | ||
delete self.metadata[token] | ||
} | ||
delete self.metadata[token] | ||
} | ||
@@ -191,6 +205,21 @@ else if (type === responseTypes.RUNTIME_ERROR) { | ||
if (typeof self.metadata[token].reject === 'function') { | ||
self.metadata[token].reject(new Err.ReqlRuntimeError(helper.makeAtom(response), self.metadata[token].query, response)); | ||
} | ||
delete self.metadata[token] | ||
if (typeof self.metadata[token].reject === 'function') { | ||
currentResolve = self.metadata[token].resolve; | ||
currentReject = self.metadata[token].reject; | ||
self.metadata[token].removeCallbacks(); | ||
currentReject(new Err.ReqlRuntimeError(helper.makeAtom(response), self.metadata[token].query, response)); | ||
if (typeof self.metadata[token].endReject !== 'function') { | ||
// No pending STOP query, we can delete | ||
delete self.metadata[token] | ||
} | ||
} | ||
else if (typeof self.metadata[token].endResolve === 'function') { | ||
currentResolve = self.metadata[token].endResolve; | ||
currentReject = self.metadata[token].endReject; | ||
self.metadata[token].removeEndCallbacks(); | ||
currentReject(new Err.ReqlRuntimeError(helper.makeAtom(response), self.metadata[token].query, response)); | ||
delete self.metadata[token] | ||
} | ||
} | ||
@@ -197,0 +226,0 @@ else if (type === responseTypes.SUCCESS_ATOM) { |
{ | ||
"name": "rethinkdbdash", | ||
"version": "2.0.14", | ||
"version": "2.0.15", | ||
"description": "A Node.js driver for RethinkDB with promises and a connection pool", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
789695
23980