mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-28 01:29:05 +01:00
do NOT catch exceptions in hooks
maybe we need some parameter to hooks-calls, if all hooks should run, before exception get's re-thrown, as with this commit first exeception in a hook, will stop other hooks from running.
This commit is contained in:
parent
d891035fbe
commit
d38cc11f7e
@ -114,7 +114,7 @@ class Hooks
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = $redirects = array();
|
$ret = array();
|
||||||
foreach((array)self::$locations[$location][$appname] as $hook)
|
foreach((array)self::$locations[$location][$appname] as $hook)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -143,22 +143,17 @@ class Hooks
|
|||||||
$ret[] = ExecMethod2($hook, $args);
|
$ret[] = ExecMethod2($hook, $args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception\Redirect $e)
|
catch (Api\Exception\AssertionFailed $e)
|
||||||
{
|
{
|
||||||
$redirects[] = $e;
|
if (preg_match('/ file .+ not found!$/', $e->getMessage()))
|
||||||
|
{
|
||||||
|
// ignore not found hook
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {
|
|
||||||
_egw_log_exception($e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($redirects)
|
|
||||||
{
|
|
||||||
if (count($redirects) > 1)
|
|
||||||
{
|
|
||||||
error_log("Multiple redirects for location '$location', only first one gets executed!");
|
|
||||||
}
|
|
||||||
throw $redirects[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// hooks only existing in filesystem used by setup
|
// hooks only existing in filesystem used by setup
|
||||||
|
Loading…
Reference in New Issue
Block a user