Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet tool update gives unfriendly error and stack on not found #36557

Closed
timheuer opened this issue Oct 30, 2023 · 2 comments
Closed

dotnet tool update gives unfriendly error and stack on not found #36557

timheuer opened this issue Oct 30, 2023 · 2 comments
Milestone

Comments

@timheuer
Copy link
Member

Describe the bug

When using dotnet tool update (or likely other methods) and the ID is not found for the tool, a full stack unhandled exception is shown instead of a user-friendly error.

To Reproduce

dotnet tool update -g pwsh

Exceptions (if any)

Unhandled exception: Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageNotFoundException: pwsh::[*, ) is not found in NuGet feeds C:\Program Files (x86)\Microsoft SDKs\NuGetPackages, https://api.nuget.org/v3/index.json
at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.GetMatchingVersionInternalAsync(String packageIdentifier, IEnumerable1 packageSources, VersionRange versionRange, CancellationToken cancellationToken) at Microsoft.DotNet.Cli.NuGetPackageDownloader.NuGetPackageDownloader.GetBestPackageVersionAsync(PackageId packageId, VersionRange versionRange, PackageSourceLocation packageSourceLocation) at Microsoft.DotNet.Cli.ToolPackage.ToolPackageDownloader.<>c__DisplayClass8_0.<InstallPackage>b__0() at Microsoft.DotNet.Cli.TransactionalAction.Run[T](Func1 action, Action commit, Action rollback)
at Microsoft.DotNet.Tools.Tool.Update.ToolUpdateGlobalOrToolPathCommand.<>c__DisplayClass14_0.b__1()
at Microsoft.DotNet.Tools.Tool.Update.ToolUpdateGlobalOrToolPathCommand.RunWithHandlingInstallError(Action installAction)
at Microsoft.DotNet.Tools.Tool.Update.ToolUpdateGlobalOrToolPathCommand.Execute()
at System.CommandLine.Invocation.InvocationPipeline.Invoke(ParseResult parseResult)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Oct 30, 2023
@JL03-Yue JL03-Yue removed the untriaged Request triage from a team member label Oct 30, 2023
@JL03-Yue JL03-Yue added this to the 8.0.2xx milestone Oct 30, 2023
@JL03-Yue
Copy link
Member

Thanks for reporting it

@JL03-Yue
Copy link
Member

JL03-Yue commented Nov 9, 2023

Thanks for reporting it. Fixed in #36641

@JL03-Yue JL03-Yue closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants