throwExceptions example

$this->eventManager->notify(
            'Enlight_Controller_Front_RouteStartup',
            $eventArgs
        );

        /* * Route request to controller/action, if a router is provided */
        try {
            $this->ensureRouter()->route($this->ensureRequest());
        } catch (Exception $e) {
            if ($this->throwExceptions()) {
                throw $e;
            }
            $this->Response()->setException($e);
        }

        /* * Notify plugins of router completion */
        $this->eventManager->notify(
            'Enlight_Controller_Front_RouteShutdown',
            $eventArgs
        );
if ($front->getParam('noErrorHandler')) {
            return;
        }

        $response = $front->Response();

        if ($this->isInsideErrorHandlerLoop) {
            $exceptions = $response->getException();
            if (\count($exceptions) > $this->exceptionCountAtFirstEncounter) {
                // Exception thrown by error handler; tell the front controller to throw it                 $front->throwExceptions(true);
                throw array_pop($exceptions);
            }

            if (\is_array($exceptions)) {
                $last = array_pop($exceptions);

                if ($this->eventManager->notifyUntil('Shopware_Components_Error_Log', [
                    'exception' => $last,
                ])) {
                    return false;
                }

                
$front->setParams($options);

        $front->setRequestStack($requestStack);

        /** @var Enlight_Plugin_PluginManager $plugins */
        $plugins = $container->get('plugins');

        $plugins->registerNamespace($front->Plugins());

        if (!empty($options['throwExceptions'])) {
            $front->throwExceptions((bool) $options['throwExceptions']);
        }

        try {
            $container->load('cache');
            $container->load('db');
            $container->load('plugins');
        } catch (Exception $e) {
            if ($front->throwExceptions()) {
                throw $e;
            }
            $front->Response()->setException($e);
        }
Home | Imprint | This part of the site doesn't use cookies.