Hook: throw exceptions for missing classes

We are otherwise not catching the resulting fatal errors right now
This commit is contained in:
Thomas Gelf 2015-11-17 17:04:04 +01:00
parent 52c3e5d8dd
commit edcc698e1e
1 changed files with 7 additions and 0 deletions

View File

@ -109,6 +109,13 @@ class Hook
} }
$class = self::$hooks[$name][$key]; $class = self::$hooks[$name][$key];
if (! class_exists($class)) {
throw new ProgrammingError(
'Erraneous hook implementation, class "%s" does not exist',
$class
);
}
try { try {
$instance = new $class(); $instance = new $class();
} catch (Exception $e) { } catch (Exception $e) {