diff --git a/lib/robot.js b/lib/robot.js index 9fff1eb..fe8653c 100644 --- a/lib/robot.js +++ b/lib/robot.js @@ -257,8 +257,12 @@ Robot.prototype.start = function() { if (!!err) { Logger.fatal("An error occured while trying to start the robot:"); Logger.fatal(err); + if (typoef(this.error) === 'function') { + this.error.call(this, err); + } + this.emit('error', err); } - }); + }.bind(this)); return this; };