Skip to content

Commit 6405acc

Browse files
committed
Incorporate review comments-Part2.
1 parent 7a3f9cd commit 6405acc

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/ResourceManager/Network/Commands.Network/Common/NetworkClient.cs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,10 @@ public async Task<AzureOperationResponse<string>> GeneratevpnclientpackageWithHt
199199
{
200200
if (DateTime.UtcNow > giveUpAt)
201201
{
202-
if (!string.IsNullOrEmpty(newHttpResponse.Content.ReadAsStringAsync().Result))
203-
{
204-
result.Body = newHttpResponse.Content.ReadAsStringAsync().Result;
205-
}
206-
else
207-
{
208-
string newResponseContent = await newHttpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
209-
throw new Exception(string.Format("Get-AzureRmVpnClientPackage Operation returned an invalid status code '{0}' with Exception:{1} while retrieving " +
210-
"the Vpnclient PackageUrl!",
211-
newHttpResponse.StatusCode, string.IsNullOrEmpty(newResponseContent) ? "NotAvailable" : newResponseContent));
212-
}
202+
string newResponseContent = await newHttpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
203+
204+
throw new Exception(string.Format("Get-AzureRmVpnClientPackage Operation returned an invalid status code '{0}' with Exception:{1} while retrieving " +
205+
"the Vpnclient PackageUrl!", newHttpResponse.StatusCode, string.IsNullOrEmpty(newResponseContent) ? "NotAvailable" : newResponseContent));
213206
}
214207
else
215208
{

0 commit comments

Comments
 (0)