Skip to content

Commit

Permalink
Merge pull request #35 from giedrioks/master
Browse files Browse the repository at this point in the history
Add update object to generic error event.
  • Loading branch information
jdwuarin committed Jan 25, 2018
2 parents f589533 + a886953 commit fb98492
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/base_bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ class BaseBot extends EventEmitter {
err.message = `"${err.message}". This is most probably on your end.`;
}

this.emit('error', err || 'empty error object');
this.emit('error', err || 'empty error object', update);
return err;
});
}
Expand Down
4 changes: 2 additions & 2 deletions lib/botmaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ class Botmaster extends EventEmitter {
}
bot.master = this;
this.bots.push(bot);
bot.on('error', (err) => {
bot.on('error', (err, update) => {
debug(err.message);
this.emit('error', bot, err);
this.emit('error', bot, err, update);
});

debug(`added bot of type: ${bot.type} with id: ${bot.id}`);
Expand Down

0 comments on commit fb98492

Please sign in to comment.