Sends a response for the given Exception.
If you have the Symfony HttpFoundation component installed, this method will use it to create and send the response. If not, it will fallback to plain PHP functions.
\Exception $exception An \Exception instance:
sendPhpResponse
createResponse
public function handle(\Exception $exception) {
if (class_exists('Symfony\\Component\\HttpFoundation\\Response')) {
$this
->createResponse($exception)
->send();
}
else {
$this
->sendPhpResponse($exception);
}
}