eZ\Publish\Core\MVC\Symfony\Controller\Content\ViewController::handleViewException PHP Method

handleViewException() protected method

protected handleViewException ( Response $response, $params, Exception $e, $viewType, $contentId = null, $locationId = null )
$response Symfony\Component\HttpFoundation\Response
$e Exception
    protected function handleViewException(Response $response, $params, Exception $e, $viewType, $contentId = null, $locationId = null)
    {
        $event = new APIContentExceptionEvent($e, array('contentId' => $contentId, 'locationId' => $locationId, 'viewType' => $viewType));
        $this->getEventDispatcher()->dispatch(MVCEvents::API_CONTENT_EXCEPTION, $event);
        if ($event->hasContentView()) {
            $response->setContent($this->viewManager->renderContentView($event->getContentView(), $params));
            return $response;
        }
        throw $e;
    }