mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
parent
0544b57db4
commit
6687524d2f
@ -14,6 +14,9 @@ next (will be 1.8.1)
|
|||||||
### User Interface
|
### User Interface
|
||||||
* FIX: don't fail when showing a Host overriding multiple inherited groups (#2253)
|
* FIX: don't fail when showing a Host overriding multiple inherited groups (#2253)
|
||||||
|
|
||||||
|
### Automation, User Interface
|
||||||
|
* FIX: error message wording on failing related (or parent) object ref (#2224)
|
||||||
|
|
||||||
1.8.0
|
1.8.0
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -535,7 +535,13 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
|
|||||||
$this->connection
|
$this->connection
|
||||||
);
|
);
|
||||||
} catch (NotFoundError $e) {
|
} catch (NotFoundError $e) {
|
||||||
throw new RuntimeException($e->getMessage(), 0, $e);
|
// Hint: eventually a NotFoundError would be better
|
||||||
|
throw new RuntimeException(sprintf(
|
||||||
|
'Unable to load object referenced from %s "%s", %s',
|
||||||
|
$this->getShortTableName(),
|
||||||
|
$this->getObjectName(),
|
||||||
|
lcfirst($e->getMessage())
|
||||||
|
), $e->getCode(), $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->reallySet($name, $object->get('id'));
|
$this->reallySet($name, $object->get('id'));
|
||||||
|
@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Objects;
|
|||||||
|
|
||||||
use Countable;
|
use Countable;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use Icinga\Exception\NotFoundError;
|
||||||
use Iterator;
|
use Iterator;
|
||||||
use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c;
|
use Icinga\Module\Director\IcingaConfig\IcingaConfigHelper as c;
|
||||||
use Icinga\Module\Director\IcingaConfig\IcingaConfigRenderer;
|
use Icinga\Module\Director\IcingaConfig\IcingaConfigRenderer;
|
||||||
@ -251,6 +252,7 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
|||||||
$connection = $this->object->getConnection();
|
$connection = $this->object->getConnection();
|
||||||
/** @var IcingaObject $class */
|
/** @var IcingaObject $class */
|
||||||
$class = $this->getImportClass();
|
$class = $this->getImportClass();
|
||||||
|
try {
|
||||||
if (is_array($this->object->getKeyName())) {
|
if (is_array($this->object->getKeyName())) {
|
||||||
// Services only
|
// Services only
|
||||||
$import = $class::load([
|
$import = $class::load([
|
||||||
@ -260,6 +262,14 @@ class IcingaObjectImports implements Iterator, Countable, IcingaConfigRenderer
|
|||||||
} else {
|
} else {
|
||||||
$import = $class::load($name, $connection);
|
$import = $class::load($name, $connection);
|
||||||
}
|
}
|
||||||
|
} catch (NotFoundError $e) {
|
||||||
|
throw new NotFoundError(sprintf(
|
||||||
|
'Unable to load parent referenced from %s "%s", %s',
|
||||||
|
$this->object->getShortTableName(),
|
||||||
|
$this->object->getObjectName(),
|
||||||
|
lcfirst($e->getMessage())
|
||||||
|
), $e->getCode(), $e);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->objects[$import->getObjectName()] = $import;
|
return $this->objects[$import->getObjectName()] = $import;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user