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