Do not crash when a server is unavailable (fixes #8).

This commit is contained in:
Julien Fontanet 2013-08-13 12:34:01 +02:00
parent e53742e554
commit 87b880d869
2 changed files with 2 additions and 6 deletions

View File

@ -15,8 +15,6 @@ function Xapi(host)
port: '443',
rejectUnauthorized: false,
}); // @todo Handle connection success/error.
this.errors = [];
}
require('util').inherits(Xapi, require('events').EventEmitter);
@ -37,10 +35,6 @@ Xapi.prototype.call = function (method) {
}
return value.Value;
})
.fail(function (error) {
self.errors.push(error);
throw error;
});
};

View File

@ -530,6 +530,8 @@ function Xo()
setTimeout(helper, 5000);
}).done();
}();
}).fail(function (error) {
console.log(error);
}).done();
});
});