Modules: Catch and log register.php exceptions

This commit is contained in:
Eric Lippmann 2013-10-20 16:40:24 +02:00
parent 4608984403
commit 077c2a078e
1 changed files with 11 additions and 4 deletions

View File

@ -29,11 +29,12 @@
namespace Icinga\Application\Modules;
use \Exception;
use \Icinga\Application\ApplicationBootstrap;
use \Icinga\Application\Config;
use \Icinga\Application\Icinga;
use \Icinga\Web\Hook;
use \Zend_Controller_Router_Route as Route;
use Icinga\Application\ApplicationBootstrap;
use Icinga\Application\Config;
use Icinga\Application\Icinga;
use Icinga\Application\Logger;
use Icinga\Web\Hook;
/**
* Module handling
@ -138,6 +139,12 @@ class Module
try {
$this->runRegisterScript();
} catch (Exception $e) {
Logger::warn(
'Running the register script %s for module %s failed with the following exception: %s',
$this->registerscript,
$this->name,
$e->getMessage()
);
return false;
}
return true;