Add error triggering

This commit is contained in:
Andrew Stewart 2014-09-30 16:13:20 -07:00
parent 81dfda5732
commit d865bac72b
1 changed files with 5 additions and 1 deletions

View File

@ -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;
};