From 9dad8183a8f0e37a6eb4d56d8c2d73e95bec82b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flor=20Chac=C3=B3n?= <14323496+florelis@users.noreply.github.com> Date: Wed, 29 Nov 2023 13:47:40 -0800 Subject: [PATCH] Fix pipeline build error (#3937) This fixes the recent build errors in the pipelines. The compiler was complaining about re-throwing an exception with `throw e;` instead of `throw;`, which messes with the stack trace. Presumably it started because of a tool update in the agents. This also fixes a compilation error I'm seeing locally from a member not being initialized. --- src/AppInstallerRepositoryCore/CompositeSource.h | 2 +- .../Helpers/AppxModuleHelper.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AppInstallerRepositoryCore/CompositeSource.h b/src/AppInstallerRepositoryCore/CompositeSource.h index 776074885c..715ecd3b0e 100644 --- a/src/AppInstallerRepositoryCore/CompositeSource.h +++ b/src/AppInstallerRepositoryCore/CompositeSource.h @@ -59,6 +59,6 @@ namespace AppInstaller::Repository Source m_installedSource; std::vector m_availableSources; SourceDetails m_details; - CompositeSearchBehavior m_searchBehavior; + CompositeSearchBehavior m_searchBehavior = CompositeSearchBehavior::Installed; }; } diff --git a/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs b/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs index 403c1e9d14..12a7fb039f 100644 --- a/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs +++ b/src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs @@ -195,7 +195,7 @@ private void AddProvisionPackage(string releaseTag) catch (RuntimeException e) { this.psCmdlet.WriteDebug($"Failed installing bundle via Add-AppxProvisionedPackage {e}"); - throw e; + throw; } } @@ -219,7 +219,7 @@ private void AddAppInstallerBundle(string releaseTag, bool downgrade) catch (RuntimeException e) { this.psCmdlet.WriteDebug($"Failed installing bundle via Add-AppxPackage {e}"); - throw e; + throw; } } @@ -384,7 +384,7 @@ private void AddAppxPackageAsUri(string packageUri, IList options = null else { this.psCmdlet.WriteError(e.ErrorRecord); - throw e; + throw; } } }