public function start() : Promise
{
try {
if ($this->state == self::STOPPED) {
if ($this->vhosts->count() === 0) {
return new Failure(new \LogicException("Cannot start: no virtual hosts registered in composed VhostContainer"));
}
return resolve($this->doStart());
} else {
return new Failure(new \LogicException("Cannot start server: already " . self::STATES[$this->state]));
}
} catch (\Throwable $uncaught) {
return new Failure($uncaught);
}
}