protected function createResponse($response, Exception $e)
    {
        $response = new HttpResponse($response->getContent(), $response->getStatusCode(), $response->headers->all());

        return $response->withException($e);
    }