mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-19 02:00:38 +01:00
Add query and notes to errors
This commit is contained in:
parent
f73de31212
commit
2efea9e25a
1 changed files with 8 additions and 8 deletions
|
@ -46,7 +46,11 @@ module.exports = Class.extend(EventEmitter,{
|
|||
bots: []
|
||||
};
|
||||
},
|
||||
finalizeState: function(state) {
|
||||
finalizeState: function(state) {},
|
||||
|
||||
finish: function(state) {
|
||||
this.finalizeState(state);
|
||||
|
||||
if(this.options.notes)
|
||||
state.notes = this.options.notes;
|
||||
|
||||
|
@ -56,13 +60,9 @@ module.exports = Class.extend(EventEmitter,{
|
|||
state.query.type = this.type;
|
||||
if('pretty' in this) state.query.pretty = this.pretty;
|
||||
|
||||
if('players' in state) state.numplayers = state.players.length;
|
||||
if('bots' in state) state.numbots = state.bots.length;
|
||||
},
|
||||
finish: function(result) {
|
||||
this.finalizeState(result);
|
||||
this.done(result);
|
||||
this.done(state);
|
||||
},
|
||||
|
||||
done: function(result) {
|
||||
if(this.finished) return;
|
||||
clearTimeout(this.globalTimeoutTimer);
|
||||
|
|
Loading…
Reference in a new issue