Skip to content

Commit

Permalink
Added some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
andersosthus committed Jan 30, 2017
1 parent 1d87df7 commit 9d87bc1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/SfRestApi/Endpoints/Register.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,24 @@ public async Task<bool> RegisterAsync(string packageName)
Logger.Log($"Registering {packageName}");
var response =
await ClusterConnection.HttpClient.PostAsync(requestUri, bodyContent).ConfigureAwait(false);
response.EnsureSuccessStatusCode();

if(!response.IsSuccessStatusCode)
{
try
{
var errorBody = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
Console.WriteLine("Things exploded...");
Console.WriteLine(errorBody);
}
catch (Exception ex)
{
return false;
}

return false;
}

return true;
}
catch (Exception ex)
{
Expand Down

0 comments on commit 9d87bc1

Please sign in to comment.