monitoring: Fix HTTP response code when showing an invalid service

refs #6281
This commit is contained in:
Eric Lippmann 2015-05-20 10:36:05 +02:00
parent ce9110d22d
commit e8c704b98d
1 changed files with 4 additions and 4 deletions

View File

@ -21,17 +21,17 @@ class Monitoring_ServiceController extends MonitoredObjectController
/** /**
* Fetch the requested service from the monitoring backend * Fetch the requested service from the monitoring backend
*
* @throws Zend_Controller_Action_Exception If the service was not found
*/ */
public function init() public function init()
{ {
$service = new Service($this->backend, $this->params->get('host'), $this->params->get('service')); $service = new Service(
$this->backend, $this->params->getRequired('host'), $this->params->getRequired('service')
);
$this->applyRestriction('monitoring/services/filter', $service); $this->applyRestriction('monitoring/services/filter', $service);
if ($service->fetch() === false) { if ($service->fetch() === false) {
throw new Zend_Controller_Action_Exception($this->translate('Service not found')); $this->httpNotFound($this->translate('Service not found'));
} }
$this->object = $service; $this->object = $service;
$this->createTabs(); $this->createTabs();