mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
try catch to tryand see error??
This commit is contained in:
parent
261f6130c8
commit
d4f972125e
34
build.cake
34
build.cake
@ -420,23 +420,31 @@ private void PublishPackages(ConvertableDirectoryPath packagesDir, ConvertableFi
|
|||||||
/// gets the resource from the specified url
|
/// gets the resource from the specified url
|
||||||
private string GetResource(string url)
|
private string GetResource(string url)
|
||||||
{
|
{
|
||||||
Information("Getting resource from " + url);
|
try
|
||||||
|
{
|
||||||
|
Information("Getting resource from " + url);
|
||||||
|
|
||||||
var assetsRequest = System.Net.WebRequest.CreateHttp(url);
|
var assetsRequest = System.Net.WebRequest.CreateHttp(url);
|
||||||
assetsRequest.Method = "GET";
|
assetsRequest.Method = "GET";
|
||||||
assetsRequest.Accept = "application/vnd.github.v3+json";
|
assetsRequest.Accept = "application/vnd.github.v3+json";
|
||||||
assetsRequest.UserAgent = "BuildScript";
|
assetsRequest.UserAgent = "BuildScript";
|
||||||
|
|
||||||
using (var assetsResponse = assetsRequest.GetResponse())
|
using (var assetsResponse = assetsRequest.GetResponse())
|
||||||
{
|
{
|
||||||
var assetsStream = assetsResponse.GetResponseStream();
|
var assetsStream = assetsResponse.GetResponseStream();
|
||||||
var assetsReader = new StreamReader(assetsStream);
|
var assetsReader = new StreamReader(assetsStream);
|
||||||
var response = assetsReader.ReadToEnd();
|
var response = assetsReader.ReadToEnd();
|
||||||
|
|
||||||
Information("Response is " + response);
|
Information("Response is " + response);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
Information("There was an exception " + exception);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool ShouldPublishToUnstableFeed(string filter, string branchName)
|
private bool ShouldPublishToUnstableFeed(string filter, string branchName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user