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;
}