private function getRequestExceptionParts(RequestException $requestException)
    {
        $response = $requestException->getResponse();
        $parts = [];
        $parts['reason'] = $response ? $response->getReasonPhrase() : $requestException->getMessage();
        $parts['code'] = $response ? $response->getStatusCode() : $requestException->getCode();
        $parts['body'] = $response ? $response->getBody() : null;

        return $parts;
    }