Skip to content

Commit

Permalink
No longer throw when attempting to hash (#2007)
Browse files Browse the repository at this point in the history
Co-authored-by: Aleksey <[email protected]>
  • Loading branch information
alexmoroz15 and Aleksey authored Jan 4, 2021
1 parent 75785cb commit 9947037
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 33 deletions.
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

0 comments on commit 9947037

Please sign in to comment.