mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Catch Rhymix\Framework\Exception in module act and triggers
This commit is contained in:
parent
72287b2fe5
commit
f6fa7493f6
2 changed files with 19 additions and 4 deletions
|
|
@ -1267,9 +1267,16 @@ class ModuleHandler extends Handler
|
|||
continue;
|
||||
}
|
||||
|
||||
$before_each_trigger_time = microtime(true);
|
||||
$output = $oModule->{$called_method}($obj);
|
||||
$after_each_trigger_time = microtime(true);
|
||||
try
|
||||
{
|
||||
$before_each_trigger_time = microtime(true);
|
||||
$output = $oModule->{$called_method}($obj);
|
||||
$after_each_trigger_time = microtime(true);
|
||||
}
|
||||
catch (Rhymix\Framework\Exception $e)
|
||||
{
|
||||
$output = new BaseObject(-2, $e->getMessage());
|
||||
}
|
||||
|
||||
if ($trigger_name !== 'common.flushDebugInfo')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -569,8 +569,16 @@ class ModuleObject extends BaseObject
|
|||
|
||||
$oModuleModel->syncSkinInfoToModuleInfo($this->module_info);
|
||||
Context::set('module_info', $this->module_info);
|
||||
|
||||
// Run
|
||||
$output = $this->{$this->act}();
|
||||
try
|
||||
{
|
||||
$output = $this->{$this->act}();
|
||||
}
|
||||
catch (Rhymix\Framework\Exception $e)
|
||||
{
|
||||
$output = new BaseObject(-2, $e->getMessage());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue