Untitled
unknown
plain_text
2 years ago
523 B
12
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