private function getErrorPageResponse(\Exception $exception, $statusCode)
    {
        $parameter = $this->application->getContainer()->getParameter('error.default');
        if ($this->application->getContainer()->hasParameter('error.'.$statusCode)) {
            $parameter = $this->application->getContainer()->getParameter('error.'.$statusCode);
        }

        $view = $this->getErrorTemplate($parameter);

        return new Response($this->renderer->partial($view, ['error' => $exception]), $statusCode);
    }