If bad start detected, shut down the Robot
This commit is contained in:
parent
42ca88f8d0
commit
5354102c2e
|
@ -295,12 +295,16 @@ Robot.prototype.start = function(callback) {
|
|||
Logger.fatal("An error occured while trying to start the robot:");
|
||||
Logger.fatal(err);
|
||||
|
||||
this.halt(function() {
|
||||
if (typeof(this.error) === "function") {
|
||||
this.error.call(this, err);
|
||||
}
|
||||
|
||||
if (this.listeners("error").length) {
|
||||
this.emit("error", err);
|
||||
}
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
if (_.isFunction(callback)) {
|
||||
callback(err, results);
|
||||
|
|
Loading…
Reference in New Issue