Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No longer throw when attempting to hash #2007

Merged
merged 1 commit into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 4 additions & 25 deletions windows/CodePush/CodePushNativeModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 3 additions & 8 deletions windows/CodePush/CodePushPackage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down