From 2f64a04226e825d06d4e6b48b2bfb571db8f06ea Mon Sep 17 00:00:00 2001 From: Muhammad Danish Date: Sat, 28 Oct 2023 01:34:12 +0500 Subject: [PATCH] Throw parse exception first --- src/WingetCreateCore/Common/PackageParser.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/WingetCreateCore/Common/PackageParser.cs b/src/WingetCreateCore/Common/PackageParser.cs index 04af7c64..3fa5acf8 100644 --- a/src/WingetCreateCore/Common/PackageParser.cs +++ b/src/WingetCreateCore/Common/PackageParser.cs @@ -219,15 +219,15 @@ public static void UpdateInstallerNodesAsync(List installerMe int numOfNewInstallers = installerMetadataList.Sum(x => x.NewInstallers.Count); - // We only allow updating manifests with the same package count - if (numOfNewInstallers != existingInstallers.Count) + if (parseFailedInstallerUrls.Any()) { - throw new InvalidOperationException(); + throw new ParsePackageException(parseFailedInstallerUrls); } - if (parseFailedInstallerUrls.Any()) + // We only allow updating manifests with the same package count + if (numOfNewInstallers != existingInstallers.Count) { - throw new ParsePackageException(parseFailedInstallerUrls); + throw new InvalidOperationException(); } Dictionary installerMatchDict = new Dictionary();