Catch FatalProtocolException from source repository initialization#15117
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the NuGet helper’s CompatibilityChecker.DownloadPackageAsync flow so FatalProtocolException thrown during source repository initialization / resource acquisition is handled consistently with failures during DoesPackageExistAsync, avoiding hard failures when a feed is non-compliant or unreachable.
Changes:
- Moves
Repository.Factory.GetCoreV3(source)andGetResourceAsync<FindPackageByIdResource>()inside the existingtry/catch (FatalProtocolException)block. - Keeps the existing “skip this source on fatal protocol issues” behavior aligned across feed resolution and existence checks.
Show a summary per file
| File | Description |
|---|---|
| nuget/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Analyze/CompatabilityChecker.cs | Wraps source repository + resource acquisition in FatalProtocolException handling while iterating package sources. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
5d51c9a to
dfd8ac0
Compare
VXianOng
approved these changes
May 22, 2026
Move sourceRepository and GetResourceAsync calls inside the existing try/catch block so that FatalProtocolException thrown during feed resolution is handled the same as failures during DoesPackageExistAsync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dfd8ac0 to
8276910
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move sourceRepository and GetResourceAsync calls inside the existing try/catch block in CompatabilityChecker.cs so that FatalProtocolException thrown during feed resolution is handled the same as failures during DoesPackageExistAsync.