ScriptExecutionFailedException example

if ($this->debug) {
            $twig->addExtension(new DebugExtension());
        }

        $twig->addExtension(new SecurityExtension([]));

        $hook = new AppScriptConditionHook($scope->getContext());

        try {
            return $this->render($twig$script$hook$name$context);
        } catch (\Throwable $e) {
            throw new ScriptExecutionFailedException($hook->getName()$script->getName()$e);
        }
    }

    /** * @return array<string, Constraint[]> */
    public function getConstraints(): array
    {
        return $this->constraints;
    }

    
                continue;
            }

            if (!$hook instanceof AppLifecycleHook && !$script->isActive()) {
                continue;
            }

            try {
                static::$isInScriptExecutionContext = true;
                $this->render($hook$script);
            } catch (\Throwable $e) {
                $scriptException = new ScriptExecutionFailedException($hook->getName()$script->getName()$e);
                $this->logger->error($scriptException->getMessage()['exception' => $e]);

                throw $scriptException;
            } finally {
                static::$isInScriptExecutionContext = false;
            }

            if ($hook instanceof StoppableHook && $hook->isPropagationStopped()) {
                break;
            }
        }
    }
Home | Imprint | This part of the site doesn't use cookies.