Skip to content

Commit cde3627

Browse files
committed
Fix exception handling in mock package downloader
1 parent 68f0638 commit cde3627

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/Microsoft.DotNet.Tools.Tests.ComponentMocks/MockNuGetPackageDownloader.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,9 @@ public Task<NuGetVersion> GetLatestPackageVersion(PackageId packageId, PackageSo
129129
return Task.FromResult(_packageVersions.Max());
130130
}
131131

132-
public Task<NuGetVersion> GetBestPackageVersionAsync(PackageId packageId, VersionRange versionRange, PackageSourceLocation packageSourceLocation = null)
132+
public async Task<NuGetVersion> GetBestPackageVersionAsync(PackageId packageId, VersionRange versionRange, PackageSourceLocation packageSourceLocation = null)
133133
{
134-
return GetBestPackageVersionAndSourceAsync(packageId, versionRange, packageSourceLocation)
135-
.ContinueWith(t => t.Result.version, TaskContinuationOptions.OnlyOnRanToCompletion);
134+
return (await GetBestPackageVersionAndSourceAsync(packageId, versionRange, packageSourceLocation)).version;
136135
}
137136

138137
public Task<(NuGetVersion version, PackageSource source)> GetBestPackageVersionAndSourceAsync(PackageId packageId,

0 commit comments

Comments
 (0)