dotnet tool update
gives unfriendly error and stack on not found
#36557
Labels
Milestone
dotnet tool update
gives unfriendly error and stack on not found
#36557
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, IEnumerable
1 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](Func
1 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)
The text was updated successfully, but these errors were encountered: