private function executeAction(callable $targetFunc, Context $context)
    {
        $returnValue = null;

        $paramValues = $context->determineParamValues($targetFunc);

        try {
            $returnValue = call_user_func_array($targetFunc, $paramValues);
        } catch (\Exception $ex) {
            $context->registerInstance($ex);

            $this->filters->trigger(Filters::ON_EXCEPTION, $context);

            if (!$this->filters->anyHandlersForEvent(Filters::ON_EXCEPTION)) {
                // If this exception was unhandled, rethrow it so it can be handled in the global scope
                throw $ex;
            }
        }
        
        return $returnValue;
    }