From 077c2a078ee0b74b8e64e99d7a9d940f1a605268 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Sun, 20 Oct 2013 16:40:24 +0200 Subject: [PATCH] Modules: Catch and log register.php exceptions --- library/Icinga/Application/Modules/Module.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index 2ea237ab5..ba422b9f0 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -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;