Skip to content

Commit

Permalink
Throw parse exception first (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanish-kh authored Oct 30, 2023
1 parent c9e4eec commit ba89591
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/WingetCreateCore/Common/PackageParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ public static void UpdateInstallerNodesAsync(List<InstallerMetadata> 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<Installer, Installer> installerMatchDict = new Dictionary<Installer, Installer>();
Expand Down

0 comments on commit ba89591

Please sign in to comment.