"actually" add query and notes to errors.

This commit is contained in:
Michael Morrison 2013-07-12 05:39:08 -05:00
parent 2efea9e25a
commit 38353b4c07
1 changed files with 8 additions and 9 deletions

View File

@ -50,6 +50,12 @@ module.exports = Class.extend(EventEmitter,{
finish: function(state) {
this.finalizeState(state);
this.done(state);
},
done: function(state) {
if(this.finished) return;
clearTimeout(this.globalTimeoutTimer);
if(this.options.notes)
state.notes = this.options.notes;
@ -60,17 +66,10 @@ module.exports = Class.extend(EventEmitter,{
state.query.type = this.type;
if('pretty' in this) state.query.pretty = this.pretty;
this.done(state);
},
done: function(result) {
if(this.finished) return;
clearTimeout(this.globalTimeoutTimer);
this.reset();
this.finished = true;
this.emit('finished',result);
if(this.options.callback) this.options.callback(result);
this.emit('finished',state);
if(this.options.callback) this.options.callback(state);
},
reset: function() {