Catch Rhymix\Framework\Exception in module act and triggers

This commit is contained in:
Kijin Sung 2018-08-26 23:46:13 +09:00
parent 72287b2fe5
commit f6fa7493f6
2 changed files with 19 additions and 4 deletions

View file

@ -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')
{

View file

@ -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
{