mirror of
https://github.com/mclueppers/xo-server.git
synced 2025-07-21 04:54:50 +02:00
Do not crash when a server is unavailable (fixes #8).
This commit is contained in:
parent
e53742e554
commit
87b880d869
@ -15,8 +15,6 @@ function Xapi(host)
|
|||||||
port: '443',
|
port: '443',
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
}); // @todo Handle connection success/error.
|
}); // @todo Handle connection success/error.
|
||||||
|
|
||||||
this.errors = [];
|
|
||||||
}
|
}
|
||||||
require('util').inherits(Xapi, require('events').EventEmitter);
|
require('util').inherits(Xapi, require('events').EventEmitter);
|
||||||
|
|
||||||
@ -37,10 +35,6 @@ Xapi.prototype.call = function (method) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return value.Value;
|
return value.Value;
|
||||||
})
|
|
||||||
.fail(function (error) {
|
|
||||||
self.errors.push(error);
|
|
||||||
throw error;
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user