Пример #1
0
 public static Exception CreateFailedException(HttpClient restClient, HttpRequestMessage requestMessage, HttpRequestException ex)
 {
     return(RestClientException.Create(HttpStatusCode.InternalServerError,
                                       ex.Message,
                                       requestMessage.ToRestClientRequest(restClient.BaseAddress),
                                       new Response(string.Empty, 0)));
 }
Пример #2
0
 public static RestClientException CreateFailedException(RSharp.RestClient restClient, RSharp.IRestResponse restResponse)
 => RestClientException.Create(restResponse.StatusCode,
                               restResponse.StatusDescription,
                               restResponse.Request.ToRestClientRequest(restClient.BaseUrl),
                               restResponse.ToRestClientRequest());
Пример #3
0
 public static RestClientException CreateFailedException(HttpClient restClient, Request request, Response response, HttpResponseMessage httpResponse)
 => RestClientException.Create(httpResponse.StatusCode,
                               httpResponse.ReasonPhrase,
                               request,
                               response);