mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
"actually" add query and notes to errors.
This commit is contained in:
parent
2efea9e25a
commit
38353b4c07
1 changed files with 8 additions and 9 deletions
|
|
@ -50,6 +50,12 @@ module.exports = Class.extend(EventEmitter,{
|
||||||
|
|
||||||
finish: function(state) {
|
finish: function(state) {
|
||||||
this.finalizeState(state);
|
this.finalizeState(state);
|
||||||
|
this.done(state);
|
||||||
|
},
|
||||||
|
|
||||||
|
done: function(state) {
|
||||||
|
if(this.finished) return;
|
||||||
|
clearTimeout(this.globalTimeoutTimer);
|
||||||
|
|
||||||
if(this.options.notes)
|
if(this.options.notes)
|
||||||
state.notes = this.options.notes;
|
state.notes = this.options.notes;
|
||||||
|
|
@ -60,17 +66,10 @@ module.exports = Class.extend(EventEmitter,{
|
||||||
state.query.type = this.type;
|
state.query.type = this.type;
|
||||||
if('pretty' in this) state.query.pretty = this.pretty;
|
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.reset();
|
||||||
this.finished = true;
|
this.finished = true;
|
||||||
this.emit('finished',result);
|
this.emit('finished',state);
|
||||||
if(this.options.callback) this.options.callback(result);
|
if(this.options.callback) this.options.callback(state);
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue