From: Hyunbin Lee Date: Mon, 2 Sep 2013 10:02:18 +0000 (+0900) Subject: Handle the exception from Registry::Flush() X-Git-Tag: submit/tizen/20131210.080830^2^2~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56472ed2cc54d348d5d33f3013fbd324cbc10ea9;p=platform%2Fframework%2Fnative%2Fappfw.git Handle the exception from Registry::Flush() Change-Id: I003c814b7a558cc11710a641be1fcdd08bbc8dcf Signed-off-by: Hyunbin Lee --- diff --git a/src/app/FApp_AppRegistryImpl.cpp b/src/app/FApp_AppRegistryImpl.cpp index f2a532e..5e36476 100644 --- a/src/app/FApp_AppRegistryImpl.cpp +++ b/src/app/FApp_AppRegistryImpl.cpp @@ -85,10 +85,13 @@ _AppRegistryImpl::Add(const String& key, const String& value) SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller..."); result r = pReg->AddValue(__sectionName, key, value); + SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Adding value to the registry has failed.", GetErrorMessage(r)); + + r = pReg->Flush(); SysTryLog(NID_APP, !IsFailed(r), "[%s] Adding value to the registry has failed.", GetErrorMessage(r)); +CATCH: delete pReg; - return r; } @@ -101,10 +104,13 @@ _AppRegistryImpl::Add(const String& key, int value) SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller..."); result r = pReg->AddValue(__sectionName, key, value); + SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Adding value to the registry has failed.", GetErrorMessage(r)); + + r = pReg->Flush(); SysTryLog(NID_APP, !IsFailed(r), "[%s] Adding value to the registry has failed.", GetErrorMessage(r)); +CATCH: delete pReg; - return r; } @@ -117,10 +123,13 @@ _AppRegistryImpl::Add(const String& key, double value) SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller..."); result r = pReg->AddValue(__sectionName, key, value); + SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Adding value to the registry has failed.", GetErrorMessage(r)); + + r = pReg->Flush(); SysTryLog(NID_APP, !IsFailed(r), "[%s] Adding value to the registry has failed.", GetErrorMessage(r)); +CATCH: delete pReg; - return r; } @@ -133,10 +142,13 @@ _AppRegistryImpl::Set(const String& key, const String& value) SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller..."); result r = pReg->SetValue(__sectionName, key, value); + SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Setting value to the registry has failed.", GetErrorMessage(r)); + + r = pReg->Flush(); SysTryLog(NID_APP, !IsFailed(r), "[%s] Setting value to the registry has failed.", GetErrorMessage(r)); +CATCH: delete pReg; - return r; } @@ -149,10 +161,13 @@ _AppRegistryImpl::Set(const String& key, int value) SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller..."); result r = pReg->SetValue(__sectionName, key, value); + SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Setting value to the registry has failed.", GetErrorMessage(r)); + + r = pReg->Flush(); SysTryLog(NID_APP, !IsFailed(r), "[%s] Setting value to the registry has failed.", GetErrorMessage(r)); +CATCH: delete pReg; - return r; } @@ -165,10 +180,13 @@ _AppRegistryImpl::Set(const String& key, double value) SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller..."); result r = pReg->SetValue(__sectionName, key, value); + SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Setting value to the registry has failed.", GetErrorMessage(r)); + + r = pReg->Flush(); SysTryLog(NID_APP, !IsFailed(r), "[%s] Setting value to the registry has failed.", GetErrorMessage(r)); +CATCH: delete pReg; - return r; }