protected DrupalKernel::handleException(\Exception $e, $request, $type)
Converts an exception into a response.
\Exception $e: An exception
Request $request: A Request instance
int $type: The type of the request (one of HttpKernelInterface::MASTER_REQUEST or HttpKernelInterface::SUB_REQUEST)
\Exception If the passed in exception cannot be turned into a response.
protected function handleException(\Exception $e, $request, $type) { if ($e instanceof HttpExceptionInterface) { $response = new Response($e->getMessage(), $e->getStatusCode()); $response->headers->add($e->getHeaders()); return $response; } else { throw $e; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!DrupalKernel.php/function/DrupalKernel::handleException/8.1.x