No longer throw when attempting to hash (#2007)

Co-authored-by: Aleksey <amoroz@uw.edu>
This commit is contained in:
alexmoroz15 2021-01-04 13:42:31 -08:00 коммит произвёл GitHub
Родитель 75785cbabc
Коммит 9947037a98
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 7 добавлений и 33 удалений

Просмотреть файл

@ -485,31 +485,10 @@ namespace Microsoft::CodePush::ReactNative
auto configuration{ CodePushConfig::Current().GetConfiguration() };
if (isRunningBinaryVersion)
{
hstring binaryHash;
try
{
auto errorMessage{ L"Error: Package hashing is currently unimplemented. Binary hash was not obtained." };
auto error{ hresult_error(E_NOTIMPL, errorMessage) };
CodePushUtils::Log(error);
throw error;
}
catch(...)
{
CodePushUtils::Log(L"Error obtaining hash for binary contents.");
promise.Resolve(configuration);
co_return;
}
if (binaryHash.empty())
{
// The hash was not generated either due to a previous unknown error or the fact that
// the React Native assets were not bundled in the binary (e.g. during release)
// builds.
promise.Resolve(configuration);
co_return;
}
configuration.Insert(PackageHashKey, JsonValue::CreateStringValue(binaryHash));
auto errorMessage{ L"Error: Package hashing is currently unimplemented. Binary hash was not obtained." };
auto error{ hresult_error(E_NOTIMPL, errorMessage) };
CodePushUtils::Log(error);
CodePushUtils::Log(L"Error obtaining hash for binary contents.");
promise.Resolve(configuration);
co_return;
}

Просмотреть файл

@ -172,14 +172,9 @@ namespace Microsoft::CodePush::ReactNative
if (needToVerifyHash)
{
try
{
auto errorMessage{ L"Error: package content verification is not currently supported." };
hresult_error error{ E_NOTIMPL, errorMessage };
CodePushUtils::Log(error);
throw error;
}
catch (...) {}
auto errorMessage{ L"Error: package content verification is not currently supported." };
hresult_error error{ E_NOTIMPL, errorMessage };
CodePushUtils::Log(error);
}
}
}