From edcc698e1eee92cf5eaa4e17a55261862a8ec8f9 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 17 Nov 2015 17:04:04 +0100 Subject: [PATCH] Hook: throw exceptions for missing classes We are otherwise not catching the resulting fatal errors right now --- library/Icinga/Application/Hook.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/Icinga/Application/Hook.php b/library/Icinga/Application/Hook.php index ed11cf458..260fd02fa 100644 --- a/library/Icinga/Application/Hook.php +++ b/library/Icinga/Application/Hook.php @@ -109,6 +109,13 @@ class Hook } $class = self::$hooks[$name][$key]; + + if (! class_exists($class)) { + throw new ProgrammingError( + 'Erraneous hook implementation, class "%s" does not exist', + $class + ); + } try { $instance = new $class(); } catch (Exception $e) {