Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update URL response handling
  • Loading branch information
praveenkuttappan committed Apr 17, 2024
commit 5fe73dc14e4bf9f193e0ba255b6163e6e1ea4592
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,18 @@ private async Task<string> getDownloadArtifactUrl(string buildId, string artifac

var connection = await CreateVssConnection();
var buildClient = connection.GetClient<BuildHttpClient>();
string url = null;
await retryPolicy.ExecuteAsync(async () =>
{
var artifact = await buildClient.GetArtifactAsync(project, int.Parse(buildId), artifactName);
return artifact?.Resource?.DownloadUrl;
url = artifact?.Resource?.DownloadUrl;
});
throw new Exception(string.Format("Failed to get download url for artifact {0} in build {1} in project {2}", artifactName, buildId, project));

if (string.IsNullOrEmpty(url))
{
throw new Exception(string.Format("Failed to get download url for artifact {0} in build {1} in project {2}", artifactName, buildId, project));
}
return url;
}

private async Task<VssConnection> CreateVssConnection()
Expand Down