You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
As much as I hate to admit it, I don't think this is the right solution. The Environment.Exit is wrong. The source of the unhandled exception is because we're running in two different "modes" in the proxy.
On CLI invocation of restore or push, we want to report a git error to CLI, then early exit from whatever command we're invoking.
When the proxy is running in a server, we want to throw a GitProcessException (which is an HttpException) because our custom ASP.NET middleware will turn that unhandled exception into a clean HTTP response for the user.
Effectively, my solution will cause the server to straight crash if anything goes wrong with any "unhandled" git exception. I'm going to refactor so we can know what mode we're in via function signature update.
As much as I hate to admit it, I don't think this is the right solution. The Environment.Exit is wrong. The source of the unhandled exception is because we're running in two different "modes" in the proxy.
On CLI invocation of restore or push, we want to report a git error to CLI, then early exit from whatever command we're invoking.
When the proxy is running in a server, we want to throw a GitProcessException (which is an HttpException) because our custom ASP.NET middleware will turn that unhandled exception into a clean HTTP response for the user.
Effectively, my solution will cause the server to straight crash if anything goes wrong with any "unhandled" git exception. I'm going to refactor so we can know what mode we're in via function signature update.
Added a bit for this exact binary setting to GitProcessHandler, and honor it. That addresses the above without entirely rewriting every usage of GitHandler.Run. Thanks for the suggestion @benbp
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.
Don't infinitely loop. Resolves #9208