Fix : The exception handling according to the situation
[platform/framework/native/content.git] / src / FCntContentTransfer.cpp
index de6a180..98d3035 100644 (file)
@@ -1,5 +1,4 @@
 //
-// Open Service Platform
 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the License);
@@ -21,7 +20,6 @@
  * This file contains implementation of the %ContentTransfer class.
  */
 
-// includes
 #include <FBaseSysLog.h>
 #include <FCntContentTransfer.h>
 #include <FBaseColIList.h>
@@ -29,7 +27,6 @@
 #include <FCnt_ContentTransferImpl.h>
 #include <FSec_AccessController.h>
 
-// using namespace
 using namespace Tizen::Base;
 using namespace Tizen::Security;
 
@@ -197,8 +194,8 @@ ContentTransfer::Download(const Utility::Uri& uri, int fileSize, const String& d
 
        // Checks the privilege
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
 
@@ -217,8 +214,8 @@ ContentTransfer::Download(const Utility::Uri& uri, const String& filePath,
 
        // Checks the privilege
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
 
@@ -235,8 +232,8 @@ ContentTransfer::DownloadToBuffer(const Utility::Uri& uri, int fileSize, Request
        result r = E_SUCCESS;
 
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
 
@@ -253,8 +250,8 @@ ContentTransfer::DownloadToBuffer(const Utility::Uri& uri, RequestId& reqId, int
        result r = E_SUCCESS;
 
        r = _AccessController::CheckUserPrivilege(_PRV_DOWNLOAD);
-       SysTryReturn(NID_CNT, r == E_SUCCESS, E_PRIVILEGE_DENIED, E_PRIVILEGE_DENIED,
-                       "[E_PRIVILEGE_DENIED] The application does not have the privilege to call this method.");
+       r = TransExceptionsExclusive(r, E_PRIVILEGE_DENIED, E_USER_NOT_CONSENTED);
+       SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "The application is not permitted to call this method.");
 
        SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");