forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor argument validation in AddPackageCatalogAsync & RemovePackag…
…eCatalogAsync to throw errors on invalid arguments, following API design guidelines. - Updated `AddPackageCatalogAsync` and `RemovePackageCatalogAsync` in `PackageManager.cpp` to perform argument validation at the beginning of the methods, ensuring early error detection and potential performance improvements. At this stage, we avoid constructing a result object for error codes and simply use a THROW statement to generate an exception for the caller. - Refactored `AddPackageCatalogWithInvalidOptions` and `RemovePackageCatalogWithInvalidOptions` in `PackageCatalogInterop.cs` to be synchronous and directly test for exceptions using `Assert.ThrowsAsync<ArgumentException>`.
- Loading branch information
1 parent
f92b947
commit 10f92be
Showing
2 changed files
with
15 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters