mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-09 22:13:05 -05:00
AddNodeForm: Don't throw error while adding existing invalid config file
This commit is contained in:
parent
da0c72d578
commit
071f006b7d
1 changed files with 8 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Icinga\Module\Businessprocess\Forms;
|
||||
|
||||
use Exception;
|
||||
use Icinga\Module\Businessprocess\BpNode;
|
||||
use Icinga\Module\Businessprocess\BpConfig;
|
||||
use Icinga\Module\Businessprocess\Common\EnumList;
|
||||
|
|
@ -471,7 +472,13 @@ class AddNodeForm extends QuickForm
|
|||
|
||||
$bp = $this->bp;
|
||||
if ($differentFile) {
|
||||
$bp = $this->storage->loadProcess($file);
|
||||
try {
|
||||
$bp = $this->storage->loadProcess($file);
|
||||
} catch (Exception $e) {
|
||||
$this->addError('Cannot add invalid config file');
|
||||
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($bp->getNodes() as $node) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue