public function sendPhpResponse($exception) { if ($exception instanceof HttpException) { $exception = FlattenException::create($exception, $exception->getCode()); } parent::sendPhpResponse($exception); }