diff --git a/src/AppInstallerCLITests/Sources.cpp b/src/AppInstallerCLITests/Sources.cpp index dc8401ccfd..95bb2fdaa4 100644 --- a/src/AppInstallerCLITests/Sources.cpp +++ b/src/AppInstallerCLITests/Sources.cpp @@ -312,14 +312,14 @@ TEST_CASE("RepoSources_InvalidYAML", "[sources]") { SetSetting(Stream::UserSources, "Name: Value : BAD"); - REQUIRE_THROWS_HR(GetSources(), APPINSTALLER_CLI_ERROR_SOURCES_INVALID); + REQUIRE_NOTHROW(GetSources()); } TEST_CASE("RepoSources_MissingField", "[sources]") { SetSetting(Stream::UserSources, s_SingleSource_MissingArg); - REQUIRE_THROWS_HR(GetSources(), APPINSTALLER_CLI_ERROR_SOURCES_INVALID); + REQUIRE_NOTHROW(GetSources()); } TEST_CASE("RepoSources_AddSource", "[sources]") @@ -1300,4 +1300,4 @@ TEST_CASE("RepoSources_BuiltInDesktopFrameworkSourceAlwaysCreatable", "[sources] { Source source(WellKnownSource::DesktopFrameworks); REQUIRE(source); -} \ No newline at end of file +} diff --git a/src/AppInstallerRepositoryCore/SourceList.cpp b/src/AppInstallerRepositoryCore/SourceList.cpp index c934e75847..e2d5ea4fb2 100644 --- a/src/AppInstallerRepositoryCore/SourceList.cpp +++ b/src/AppInstallerRepositoryCore/SourceList.cpp @@ -145,7 +145,10 @@ namespace AppInstaller::Repository else { std::vector result; - THROW_HR_IF(APPINSTALLER_CLI_ERROR_SOURCES_INVALID, !TryReadSourceDetails(setting.GetName(), *sourcesStream, rootName, parse, result)); + if (!TryReadSourceDetails(setting.GetName(), *sourcesStream, rootName, parse, result)) + { + AICLI_LOG(YAML, Error, << "Ignoring corrupted source data."); + } return result; } }