Commit 8d90d07e authored by Andrii Grynenko's avatar Andrii Grynenko Committed by Facebook Github Bot 2

Don't throw on late singleton registration

Summary: Having singleton registered after registrationComplete() is called is not a hard failure. Replacing exception with ERROR, since we probably still want to avoid such situation.

Reviewed By: yfeldblum

Differential Revision: D3266376

fb-gh-sync-id: 8130d279775348c835265987c95189bd3d8106f9
fbshipit-source-id: 8130d279775348c835265987c95189bd3d8106f9
parent ceaca5b0
......@@ -78,8 +78,7 @@ void SingletonVault::registerSingleton(detail::SingletonHolderBase* entry) {
stateCheck(SingletonVaultState::Running);
if (UNLIKELY(registrationComplete_)) {
throw std::logic_error(
"Registering singleton after registrationComplete().");
LOG(ERROR) << "Registering singleton after registrationComplete().";
}
RWSpinLock::ReadHolder rhMutex(&mutex_);
......@@ -96,8 +95,7 @@ void SingletonVault::addEagerInitSingleton(detail::SingletonHolderBase* entry) {
stateCheck(SingletonVaultState::Running);
if (UNLIKELY(registrationComplete_)) {
throw std::logic_error(
"Registering for eager-load after registrationComplete().");
LOG(ERROR) << "Registering for eager-load after registrationComplete().";
}
RWSpinLock::ReadHolder rhMutex(&mutex_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment