diff --git a/lib/query.js b/lib/query.js index 8becda9..e8a458a 100644 --- a/lib/query.js +++ b/lib/query.js @@ -74,8 +74,9 @@ p.submit = function(connection) { if(self.callback) { self.callback(err); connection.removeListener('commandComplete', onCommandComplete); + } else { + self.emit('error', err); } - self.emit('error', err); self.emit('end'); }; @@ -178,7 +179,7 @@ var dateParser = function(isoDate) { var end = splitTime[2]; var seconds = /(\d{2})/.exec(end); seconds = (seconds ? seconds[1] : 0); - seconds = parseInt(seconds,10); + seconds = parseInt(seconds,10); var mili = /\.(\d{1,})/.exec(end); mili = mili ? mili[1].slice(0,3) : 0; var tZone = /([Z|+\-])(\d{2})?(\d{2})?/.exec(end);