in sdk/PowerBI.Api/Imports/ImportsOperations.cs [401:423]
private async Task VerifyStatusCode(HttpResponseMessage responseMessage, HttpStatusCode statusCode)
{
if (responseMessage.StatusCode != statusCode)
{
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", responseMessage.StatusCode));
var responseContent = string.Empty;
if (responseMessage.Content != null)
{
responseContent = await responseMessage.Content.ReadAsStringAsync();
}
ex.Request = new HttpRequestMessageWrapper(responseMessage.RequestMessage, null);
ex.Response = new HttpResponseMessageWrapper(responseMessage, responseContent);
if (ServiceClientTracing.IsEnabled)
{
ServiceClientTracing.Error(null, ex);
}
throw ex;
}
}