From 56472ed2cc54d348d5d33f3013fbd324cbc10ea9 Mon Sep 17 00:00:00 2001 From: Hyunbin Lee Date: Mon, 2 Sep 2013 19:02:18 +0900 Subject: [PATCH] Handle the exception from Registry::Flush() Change-Id: I003c814b7a558cc11710a641be1fcdd08bbc8dcf Signed-off-by: Hyunbin Lee --- src/app/FApp_AppRegistryImpl.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) 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; } -- 2.7.4