In the newer versions of ASP.NET Core, the HttpError type is not available. Instead, you can handle the error response using the HttpResponseMessage object and extract the error message from the response content. Here's an example:

if (!response.IsSuccessStatusCode)
{
    string statusCode = response.StatusCode.ToString();
    string reasonPhrase = response.ReasonPhrase;

    string errorMessage = string.Empty;
    string errorMessageDetail = string.Empty;

    if (response.Content != null)
    {
        string responseContent = await response.Content.ReadAsStringAsync();
        // You may need to customize the parsing logic based on the response content type (e.g., JSON, XML, plain text, etc.)
        // Here's an example for parsing a JSON response
        var errorData = JObject.Parse(responseContent);
        errorMessage = errorData["message"]?.ToString();
        errorMessageDetail = errorData["messageDetail"]?.ToString();
    }

    System.Diagnostics.Debug.WriteLine($"{statusCode} {reasonPhrase}");
    System.Diagnostics.Debug.WriteLine(errorMessage);
    System.Diagnostics.Debug.WriteLine(errorMessageDetail);
}

This code retrieves the status code, reason phrase, error message, and error message detail from the response. It assumes the response content is in JSON format, but you may need to adjust the parsing logic based on the actual response content type.

Please note that the specific structure and properties of the error response may vary depending on the API you're working with. Make sure to adapt the code to match the structure of the error response you receive.