mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-25 06:44:37 +02:00
Import: use IcingaException, add a TODO
This commit is contained in:
parent
9ec520c788
commit
1bbd07efe1
@ -5,6 +5,7 @@ namespace Icinga\Module\Director\Import;
|
|||||||
use Icinga\Module\Director\Objects\ImportSource;
|
use Icinga\Module\Director\Objects\ImportSource;
|
||||||
use Icinga\Module\Director\Util;
|
use Icinga\Module\Director\Util;
|
||||||
use Icinga\Module\Director\Web\Hook\ImportSourceHook;
|
use Icinga\Module\Director\Web\Hook\ImportSourceHook;
|
||||||
|
use Icinga\Exception\IcingaException;
|
||||||
|
|
||||||
class Import
|
class Import
|
||||||
{
|
{
|
||||||
@ -33,13 +34,12 @@ class Import
|
|||||||
foreach (ImportSourceHook::loadByName($source->source_name, $connection)->fetchData() as $row) {
|
foreach (ImportSourceHook::loadByName($source->source_name, $connection)->fetchData() as $row) {
|
||||||
// TODO: Check for name collision
|
// TODO: Check for name collision
|
||||||
if (! isset($row->$keyColumn)) {
|
if (! isset($row->$keyColumn)) {
|
||||||
continue;
|
// TODO: re-enable errors
|
||||||
throw new \Exception(
|
continue;
|
||||||
sprintf(
|
throw new IcingaException(
|
||||||
'No key column "%s" in row: %s',
|
'No key column "%s" in row: %s',
|
||||||
$keyColumn,
|
$keyColumn,
|
||||||
json_encode($row)
|
json_encode($row)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user