From ba89591e163e8aa7f7ea9e4d703ac42b11141e1c Mon Sep 17 00:00:00 2001 From: Muhammad Danish Date: Tue, 31 Oct 2023 02:22:40 +0500 Subject: [PATCH] Throw parse exception first (#465) --- 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();