Skip to content

Commit

Permalink
try catch to tryand see error??
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Pallister authored and Tom Pallister committed Oct 10, 2017
1 parent 261f613 commit d4f9721
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -420,23 +420,31 @@ private void PublishPackages(ConvertableDirectoryPath packagesDir, ConvertableFi
/// gets the resource from the specified url
private string GetResource(string url)
{
Information("Getting resource from " + url);
try
{
Information("Getting resource from " + url);

var assetsRequest = System.Net.WebRequest.CreateHttp(url);
assetsRequest.Method = "GET";
assetsRequest.Accept = "application/vnd.github.v3+json";
assetsRequest.UserAgent = "BuildScript";
var assetsRequest = System.Net.WebRequest.CreateHttp(url);
assetsRequest.Method = "GET";
assetsRequest.Accept = "application/vnd.github.v3+json";
assetsRequest.UserAgent = "BuildScript";

using (var assetsResponse = assetsRequest.GetResponse())
{
var assetsStream = assetsResponse.GetResponseStream();
var assetsReader = new StreamReader(assetsStream);
var response = assetsReader.ReadToEnd();
using (var assetsResponse = assetsRequest.GetResponse())
{
var assetsStream = assetsResponse.GetResponseStream();
var assetsReader = new StreamReader(assetsStream);
var response = assetsReader.ReadToEnd();

Information("Response is " + response);

return response;
}
Information("Response is " + response);

return response;
}
}
catch(Exception exception)
{
Information("There was an exception " + exception);
throw;
}
}

private bool ShouldPublishToUnstableFeed(string filter, string branchName)
Expand Down

0 comments on commit d4f9721

Please sign in to comment.