Reputation: 291
I have started to play with the dev version of ZF2 in the current dev-develop branch and since then I am getting white screen on every exception, thrown somewhere in the views.
I have installed the SkeletonApplication to see, if it is something in my application, that was causing it, but same problem appear there too. Downgrading to dev-master solves the problem and I am getting the standard exception dump.
Looking into the zf2 code I think I have found the reason for this. In Zend\Mvc\View\Http\DefaultRenderingStrategy::render() now we have:
public function render(MvcEvent $e)
{
......
try {
$view->render($viewModel);
} catch(\Exception $ex) {
$application = $e->getApplication();
$events = $application->getEventManager();
$e->setError(Application::ERROR_EXCEPTION)
->setParam('exception', $ex);
$events->trigger(MvcEvent::EVENT_RENDER_ERROR, $e);
}
return $response;
}
So the Exception is catched, but the response is empty and I have no clue about the cause of the latter.
However another question appears: How is the error handler going to render the exception page, if the error is triggered in the layout? (Like in my case - the navigation helper, which was unable to find the container.) The only possible solution is to have an extra error layout, but this is pointless, since the reason of having a nice exception handling is not present anymore.
So following questions are arising:
Upvotes: 2
Views: 1488
Reputation: 1655
Check your zf2 config files to make sure you have opened exception display options:
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
),
Upvotes: -1