Skip to content

Commit 9947037

Browse files
alexmoroz15Aleksey
and
Aleksey
authored
No longer throw when attempting to hash (#2007)
Co-authored-by: Aleksey <[email protected]>
1 parent 75785cb commit 9947037

File tree

2 files changed

+7
-33
lines changed

2 files changed

+7
-33
lines changed

windows/CodePush/CodePushNativeModule.cpp

+4-25
Original file line numberDiff line numberDiff line change
@@ -485,31 +485,10 @@ namespace Microsoft::CodePush::ReactNative
485485
auto configuration{ CodePushConfig::Current().GetConfiguration() };
486486
if (isRunningBinaryVersion)
487487
{
488-
hstring binaryHash;
489-
try
490-
{
491-
auto errorMessage{ L"Error: Package hashing is currently unimplemented. Binary hash was not obtained." };
492-
auto error{ hresult_error(E_NOTIMPL, errorMessage) };
493-
CodePushUtils::Log(error);
494-
throw error;
495-
}
496-
catch(...)
497-
{
498-
CodePushUtils::Log(L"Error obtaining hash for binary contents.");
499-
promise.Resolve(configuration);
500-
co_return;
501-
}
502-
503-
if (binaryHash.empty())
504-
{
505-
// The hash was not generated either due to a previous unknown error or the fact that
506-
// the React Native assets were not bundled in the binary (e.g. during release)
507-
// builds.
508-
promise.Resolve(configuration);
509-
co_return;
510-
}
511-
512-
configuration.Insert(PackageHashKey, JsonValue::CreateStringValue(binaryHash));
488+
auto errorMessage{ L"Error: Package hashing is currently unimplemented. Binary hash was not obtained." };
489+
auto error{ hresult_error(E_NOTIMPL, errorMessage) };
490+
CodePushUtils::Log(error);
491+
CodePushUtils::Log(L"Error obtaining hash for binary contents.");
513492
promise.Resolve(configuration);
514493
co_return;
515494
}

windows/CodePush/CodePushPackage.cpp

+3-8
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,9 @@ namespace Microsoft::CodePush::ReactNative
172172

173173
if (needToVerifyHash)
174174
{
175-
try
176-
{
177-
auto errorMessage{ L"Error: package content verification is not currently supported." };
178-
hresult_error error{ E_NOTIMPL, errorMessage };
179-
CodePushUtils::Log(error);
180-
throw error;
181-
}
182-
catch (...) {}
175+
auto errorMessage{ L"Error: package content verification is not currently supported." };
176+
hresult_error error{ E_NOTIMPL, errorMessage };
177+
CodePushUtils::Log(error);
183178
}
184179
}
185180
}

0 commit comments

Comments
 (0)