ConfigCommand: Fix `Variable '$webserver' is probably undefined` and import missing `Exception` class

This commit is contained in:
Sukhwinder Dhillon 2023-08-16 10:59:58 +02:00 committed by raviks789
parent 7adc25ba38
commit d1bfde0dc5
1 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ namespace Icinga\Module\Setup\Clicommands;
use Icinga\Application\Logger;
use Icinga\Cli\Command;
use Icinga\Exception\IcingaException;
use Icinga\Exception\ProgrammingError;
use Icinga\Module\Setup\Webserver;
@ -128,6 +129,8 @@ class ConfigCommand extends Command
if (($type = $this->params->getStandalone()) === null) {
$this->fail($this->translate('Argument type is mandatory.'));
}
$webserver = null;
try {
$webserver = Webserver::createInstance($type);
} catch (ProgrammingError $e) {