mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
DirectorJob: do not throw NotFound
This commit is contained in:
parent
eaf0a5e92d
commit
7d7c4defdf
@ -92,7 +92,6 @@ class DirectorJob extends DbObjectWithSettings implements ExportInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \Icinga\Exception\NotFoundError
|
|
||||||
*/
|
*/
|
||||||
public function shouldRun()
|
public function shouldRun()
|
||||||
{
|
{
|
||||||
@ -101,7 +100,6 @@ class DirectorJob extends DbObjectWithSettings implements ExportInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \Icinga\Exception\NotFoundError
|
|
||||||
*/
|
*/
|
||||||
public function isOverdue()
|
public function isOverdue()
|
||||||
{
|
{
|
||||||
@ -121,7 +119,6 @@ class DirectorJob extends DbObjectWithSettings implements ExportInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \Icinga\Exception\NotFoundError
|
|
||||||
*/
|
*/
|
||||||
public function isPending()
|
public function isPending()
|
||||||
{
|
{
|
||||||
@ -138,7 +135,6 @@ class DirectorJob extends DbObjectWithSettings implements ExportInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \Icinga\Exception\NotFoundError
|
|
||||||
*/
|
*/
|
||||||
public function isWithinTimeperiod()
|
public function isWithinTimeperiod()
|
||||||
{
|
{
|
||||||
@ -266,10 +262,16 @@ class DirectorJob extends DbObjectWithSettings implements ExportInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IcingaTimePeriod
|
* @return IcingaTimePeriod
|
||||||
* @throws \Icinga\Exception\NotFoundError
|
|
||||||
*/
|
*/
|
||||||
protected function timeperiod()
|
protected function timeperiod()
|
||||||
{
|
{
|
||||||
return IcingaTimePeriod::loadWithAutoIncId($this->get('timeperiod_id'), $this->connection);
|
try {
|
||||||
|
return IcingaTimePeriod::loadWithAutoIncId($this->get('timeperiod_id'), $this->connection);
|
||||||
|
} catch (NotFoundError $e) {
|
||||||
|
throw new \RuntimeException(sprintf(
|
||||||
|
'The TimePeriod configured for Job "%s" could not have been found',
|
||||||
|
$this->get('name')
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user