Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zhili1208 committed Mar 14, 2016
1 parent 2dbd048 commit 90f92e3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/NuGet.Core/NuGet.Protocol.Core.v3/LegacyFeed/V2FeedParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,20 @@ public async Task<V2FeedPackageInfo> GetPackage(
package.Id,
package.Version.ToNormalizedString());

// Try to find the package directly
// Set max count to -1, get all packages
var packages = await QueryV2Feed(uri, package.Id, -1, log, token);
var packages = new List<V2FeedPackageInfo>();

try
{
// Try to find the package directly for better perf
// Set max count to -1, get all packages
packages = await QueryV2Feed(uri, package.Id, -1, log, token);
}
catch(Exception e)
{
// ProGet does not support normalized version
// Catch all exceptions for /Packages endpoint when server throw
log.LogDebug(e.ToString());
}

// If not found use FindPackagesById
if (packages.Count < 1)
Expand Down

0 comments on commit 90f92e3

Please sign in to comment.