use SysPropagate() log
authorYoung Ik Cho <youngik.cho@samsung.com>
Fri, 11 Oct 2013 02:47:48 +0000 (11:47 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Fri, 11 Oct 2013 02:47:48 +0000 (11:47 +0900)
Change-Id: I9d0b20890c850195a43f8ba77b7cd953ed756b51
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FAppAppManager.cpp [changed mode: 0755->0644]
src/app/FApp_ActiveWindowManager.cpp
src/app/FApp_AppControlImpl.cpp
src/app/FApp_AppControlProviderManagerImpl.cpp
src/app/FApp_AppControlRegistry.cpp
src/app/FApp_AppImpl.cpp
src/app/FApp_AppInfo.cpp [changed mode: 0755->0644]
src/app/FApp_AppRegistryImpl.cpp
src/app/FApp_NotificationManagerImpl.cpp

old mode 100755 (executable)
new mode 100644 (file)
index 719256c..a3fcc04
@@ -76,7 +76,11 @@ AppManager::Construct(void)
        SysTryReturnResult(NID_APP, __pAppManagerImpl != null, E_OUT_OF_MEMORY, "");
 
        r = __pAppManagerImpl->Construct();
-       SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               goto CATCH;
+       }
 
        return r;
 
@@ -150,8 +154,7 @@ AppManager::GetAppSharedPath(const AppId& appId)
        String sharedPath;
 
        result r = _AppManagerImpl::GetAppRootPath(appId, sharedPath);
-       SysTryReturn(NID_APP, !IsFailed(r), sharedPath, r, "[%s] Propagating to caller...",
-                       GetErrorMessage(r));
+       SysTryReturn(NID_APP, !IsFailed(r), sharedPath, r, "[%s] Propagating to caller...", GetErrorMessage(r));
 
        sharedPath.Append(L"shared/");
 
index 1088790..b0cf879 100644 (file)
@@ -36,7 +36,6 @@
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
-//using namespace Tizen::Base::Utility;
 using namespace Tizen::Base::Runtime;
 
 namespace
@@ -239,7 +238,11 @@ _ActiveWindowManager::AddActiveAppEventListener(IActiveAppEventListener& listene
        bool alreadyExist = __activeAppEventListenerList.Contains(&listener);
        SysTryReturnResult(NID_APP, !alreadyExist, E_OBJ_ALREADY_EXIST, "The event listener already exist.");
        result r = __activeAppEventListenerList.Add(&listener);
-       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        if (!pWindowPropertyChanged)
        {
@@ -275,7 +278,11 @@ _ActiveWindowManager::RemoveActiveAppEventListener(IActiveAppEventListener& list
        }
 
        result r = __activeAppEventListenerList.Remove(&listener);
-       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        if (__activeAppEventListenerList.GetCount() == 0)
        {
index d5db899..2e0aca6 100644 (file)
@@ -208,7 +208,11 @@ _AppControlImpl::StartImplicit(const _AppMessageImpl& msg, IEventListener* pList
        int req = _REQ_ID_INVALID;
 
        _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(ACTL_IMPLICIT_PLUGIN);
-       SysTryReturnResult(NID_APP, pProvider != null, E_OBJ_NOT_FOUND, "Propagating.");
+       if (pProvider == null)
+       {
+               SysPropagate(NID_APP, E_OBJ_NOT_FOUND);
+               return E_OBJ_NOT_FOUND;
+       }
 
        if (pListener)
        {
@@ -270,7 +274,11 @@ _AppControlImpl::Start(const IList* pDataList, IAppControlEventListener* pListen
        int req = _REQ_ID_INVALID;
 
        _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(_path);
-       SysTryReturnResult(NID_APP, pProvider != null, E_OBJ_NOT_FOUND, "Propagating.");
+       if (pProvider == null)
+       {
+               SysPropagate(NID_APP, E_OBJ_NOT_FOUND);
+               return E_OBJ_NOT_FOUND;
+       }
 
        if (pListener)
        {
@@ -314,7 +322,11 @@ _AppControlImpl::Start(const String* pUriData, const String* pMimeType, const IM
        result r = E_SUCCESS;
 
        _IAppControlPluginProvider* pProvider = GetAppControlPluginProvider(_path);
-       SysTryReturnResult(NID_APP, pProvider != null, E_OBJ_NOT_FOUND, "Propagating.");
+       if (pProvider == null)
+       {
+               SysPropagate(NID_APP, E_OBJ_NOT_FOUND);
+               return E_OBJ_NOT_FOUND;
+       }
 
        if (pListener)
        {
index 2250b0d..71aa878 100644 (file)
@@ -76,7 +76,11 @@ _AppControlProviderManagerImpl::SendAppControlResult(RequestId reqId, const ILis
 
        _AppArg resArg;
        result r = resArg.ConstructResult(arg, pResultList);
-       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        const bool isService = _AppInfo::GetAppType() & _APP_TYPE_SERVICE_APP;
 
@@ -104,7 +108,11 @@ _AppControlProviderManagerImpl::SendAppControlResult(RequestId reqId, AppCtrlRes
 
        _AppArg resArg;
        result r = resArg.ConstructResult(arg, pResultMap);
-       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        const int code = appControlResult;
        int res = APPSVC_RES_NOT_OK;
index 6c97827..ab02cf5 100644 (file)
@@ -107,7 +107,11 @@ _AppControlRegistry::LoadTizenAppControlRegistry(void)
        const String regPath = ACTL_DEFAULT_FILE;
 
        result r = reg.Construct(regPath, REG_OPEN_READ_ONLY, null);
-       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        const int secCount = reg.GetAllSectionCount();
        SysTryReturnResult(NID_APP, !(secCount <= 0), E_OBJ_NOT_FOUND, "Registry contains no data.");
@@ -156,7 +160,11 @@ _AppControlRegistry::LoadLegacyList(void)
        const String& regPath(ACTL_LEGACY_FILE);
 
        result r = reg.Construct(regPath, REG_OPEN_READ_ONLY, null);
-       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        const int sec_count = reg.GetAllSectionCount();
        SysTryReturnResult(NID_APP, !(sec_count <= 0), E_OBJ_NOT_FOUND, "Registry contains no data.");
@@ -205,7 +213,7 @@ _AppControlRegistry::LoadLegacyList(void)
                        r = reg.GetValue(secName, *pStr, value);
                        if (IsFailed(r))
                        {
-                               SysLog(NID_APP, "[%s] Propagating.", GetErrorMessage(r));
+                               SysPropagate(NID_APP, r);
                                continue;
                        }
 
index b7485b0..b1b52fb 100644 (file)
@@ -515,7 +515,11 @@ _AppImpl::RegisterAppRequest(service_s* service, int& req, _AppHandler& handler)
        SysTryReturnResult(NID_APP, pManager != null, E_SYSTEM, "Wrong system state.");
 
        result r = pManager->RegisterRequest(service, req, handler);
-       SysTryReturn(NID_APP, !IsFailed(r), r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (IsFailed(r))
+       {
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        int providerType = _AppInfo::GetAppHandlerType();
        providerType |= (_APP_HANDLER_LAUNCH_NORMAL | _APP_HANDLER_LAUNCH_COND);
old mode 100755 (executable)
new mode 100644 (file)
index e74a86b..61cbd24
@@ -277,7 +277,12 @@ _AppInfo::UpdateAppInfoFromPackageInfo(const PackageId& packageId)
 
        result r = E_SUCCESS;
        std::unique_ptr<PackageInfo> pInfo(pPkg->GetPackageInfoN(packageId));
-       SysTryReturn(NID_APP, pInfo != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       if (pInfo.get() == null)
+       {
+               r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        const _PackageInfoImpl* pPkgInfo = _PackageInfoImpl::GetInstance(pInfo.get());
        SysTryReturnResult(NID_APP, pPkgInfo != null, E_INVALID_STATE, "Invalid PackageInfo instance.");
index 1914ff2..27eb361 100644 (file)
@@ -87,7 +87,12 @@ _AppRegistryImpl::Add(const String& key, const String& value)
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadWrite);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->AddValue(__sectionName, key, value);
        SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Adding value to the registry has failed.", GetErrorMessage(r));
@@ -106,7 +111,12 @@ _AppRegistryImpl::Add(const String& key, int value)
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadWrite);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->AddValue(__sectionName, key, value);
        SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Adding value to the registry has failed.", GetErrorMessage(r));
@@ -125,7 +135,12 @@ _AppRegistryImpl::Add(const String& key, double value)
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadWrite);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->AddValue(__sectionName, key, value);
        SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Adding value to the registry has failed.", GetErrorMessage(r));
@@ -144,7 +159,12 @@ _AppRegistryImpl::Set(const String& key, const String& value)
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadWrite);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->SetValue(__sectionName, key, value);
        SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Setting value to the registry has failed.", GetErrorMessage(r));
@@ -163,7 +183,12 @@ _AppRegistryImpl::Set(const String& key, int value)
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadWrite);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->SetValue(__sectionName, key, value);
        SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Setting value to the registry has failed.", GetErrorMessage(r));
@@ -182,7 +207,12 @@ _AppRegistryImpl::Set(const String& key, double value)
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadWrite);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->SetValue(__sectionName, key, value);
        SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Setting value to the registry has failed.", GetErrorMessage(r));
@@ -207,7 +237,12 @@ _AppRegistryImpl::Remove(const String& key)
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadWrite);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->RemoveValue(__sectionName, key);
        SysTryLog(NID_APP, !IsFailed(r), "[%s] Removing value to the registry has failed.", GetErrorMessage(r));
@@ -223,7 +258,12 @@ _AppRegistryImpl::Get(const String& key, String& value) const
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadOnly);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->GetValue(__sectionName, key, value);
        SysTryLog(NID_APP, !IsFailed(r), "[%s] Getting value to the registry has failed.", GetErrorMessage(r));
@@ -239,7 +279,12 @@ _AppRegistryImpl::Get(const String& key, int& value) const
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadOnly);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->GetValue(__sectionName, key, value);
        SysTryLog(NID_APP, !IsFailed(r), "[%s] Getting value to the registry has failed.", GetErrorMessage(r));
@@ -255,7 +300,12 @@ _AppRegistryImpl::Get(const String& key, double& value) const
        MutexGuard lock(__mutex);
 
        Registry* pReg = LoadN(ReadOnly);
-       SysTryReturnResult(NID_APP, pReg != null, GetLastResult(), "Propagating to caller...");
+       if (pReg == null)
+       {
+               result r = GetLastResult();
+               SysPropagate(NID_APP, r);
+               return r;
+       }
 
        result r = pReg->GetValue(__sectionName, key, value);
        SysTryLog(NID_APP, !IsFailed(r), "[%s] Getting value to the registry has failed.", GetErrorMessage(r));
index a567d52..82fbbf4 100644 (file)
@@ -185,7 +185,11 @@ _NotificationManagerImpl::NotifyImpl(const String& messageText, int badgeNumber,
                SysTryCatch(NID_APP, pkgname != NULL, r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Cannot acquire package name for current application.");
 
                r = arg.Construct(launchArguments);
-               SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
+               if (IsFailed(r))
+               {
+                       SysPropagate(NID_APP, r);
+                       goto CATCH;
+               }
 
                pKb = arg.GetBundle();
                service_create_request(pKb, &svc);
@@ -294,7 +298,11 @@ _NotificationManagerImpl::NotifyImpl(const AppId& appId, const String& messageTe
 
 
                r = arg.Construct(launchArguments);
-               SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
+               if (IsFailed(r))
+               {
+                       SysPropagate(NID_APP, r);
+                       goto CATCH;
+               }
 
                pKb = arg.GetBundle();
                service_create_request(pKb, &svc);