Untitled
Anonymous
plain_text
05/10/2024 2:45 PM
700 B
22
Indexable
private static HttpRequestException CreateResponseException(HttpResponseMessage response, string responseContent)
{
switch (response.StatusCode)
{
case HttpStatusCode.InternalServerError:
var problemDetails = JsonSerializer.Deserialize<ProblemDetails>(responseContent);
return new HttpRequestException(problemDetails.Title, null, response.StatusCode);
default:
return new HttpRequestException(response.ReasonPhrase, null, response.StatusCode);
}
}Editor is loading...
Leave a Comment