mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
Add try...catch to trigger functions
This commit is contained in:
parent
b048200a30
commit
9b6e88bc33
1 changed files with 10 additions and 3 deletions
|
|
@ -1300,9 +1300,16 @@ class ModuleHandler extends Handler
|
|||
$trigger_functions = $oModuleModel->getTriggerFunctions($trigger_name, $called_position);
|
||||
foreach($trigger_functions as $item)
|
||||
{
|
||||
$before_each_trigger_time = microtime(true);
|
||||
$output = $item($obj);
|
||||
$after_each_trigger_time = microtime(true);
|
||||
try
|
||||
{
|
||||
$before_each_trigger_time = microtime(true);
|
||||
$output = $item($obj);
|
||||
$after_each_trigger_time = microtime(true);
|
||||
}
|
||||
catch (Rhymix\Framework\Exception $e)
|
||||
{
|
||||
$output = new BaseObject(-2, $e->getMessage());
|
||||
}
|
||||
|
||||
if ($trigger_name !== 'common.writeSlowlog')
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue