monitoring: Fix HTTP response code when showing an invalid host
refs #6281
This commit is contained in:
parent
e8c704b98d
commit
0b81a1130f
|
@ -21,17 +21,15 @@ class Monitoring_HostController extends MonitoredObjectController
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the requested host from the monitoring backend
|
* Fetch the requested host from the monitoring backend
|
||||||
*
|
|
||||||
* @throws Zend_Controller_Action_Exception If the host was not found
|
|
||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$host = new Host($this->backend, $this->params->get('host'));
|
$host = new Host($this->backend, $this->params->getRequired('host'));
|
||||||
|
|
||||||
$this->applyRestriction('monitoring/hosts/filter', $host);
|
$this->applyRestriction('monitoring/hosts/filter', $host);
|
||||||
|
|
||||||
if ($host->fetch() === false) {
|
if ($host->fetch() === false) {
|
||||||
throw new Zend_Controller_Action_Exception($this->translate('Host not found'));
|
$this->httpNotFound($this->translate('Host not found'));
|
||||||
}
|
}
|
||||||
$this->object = $host;
|
$this->object = $host;
|
||||||
$this->createTabs();
|
$this->createTabs();
|
||||||
|
|
Loading…
Reference in New Issue